小编Tho*_*win的帖子

是否可以在Android Room中使用String作为PrimaryKey

我在我的java后端服务器中使用uuid.因此我需要在房间android中使用该uuid以确保实体正确同步.我知道是否有可能在Android的数据库中的文本字段应用的主键文本作为android系统中的PrimaryKey.我想创造这样的东西

@Entity(tableName = CrewColumns.TABLE_NAME)
@TypeConverters(BigDecimalConverter::class)
@JsonIgnoreProperties(ignoreUnknown = true)
class Crew() {
    constructor (uuid: String) : this() {
        this.uuid = uuid;
    }

    /**
     * The unique ID of the item.
     */
    @PrimaryKey
    @ColumnInfo(name = CrewColumns.UUID)
    var uuid: String = ""
    @ColumnInfo(name = CrewColumns.NAME)
    var name: String = ""
}
Run Code Online (Sandbox Code Playgroud)

Room(DAO等)会出现问题吗?谢谢.

java android kotlin android-room

11
推荐指数
1
解决办法
5799
查看次数

如何使用jasperreports和barcode4j对齐条形码

我使用的是iReport 5.5.0.如何居中对齐条形码组件?

我的jrxml的相关片段如下.

        <componentElement>
            <reportElement x="0" y="9" width="113" height="36" uuid="a11badb4-7c31-4011-83ae-f287b457939a"/>
            <jr:Code128 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" textPosition="bottom">
                <jr:codeExpression><![CDATA[$F{number}]]></jr:codeExpression>
            </jr:Code128>
        </componentElement>
Run Code Online (Sandbox Code Playgroud)

jasper-reports barcode4j

5
推荐指数
1
解决办法
4153
查看次数

标签 统计

android ×1

android-room ×1

barcode4j ×1

jasper-reports ×1

java ×1

kotlin ×1