Realm version:
classpath "io.realm:realm-gradle-plugin:5.8.0"
I found that I should add modules to io.realm.RealmConfiguration. So I made this:
RealmConfiguration.Builder builder = new RealmConfiguration.Builder()
.deleteRealmIfMigrationNeeded()
.schemaVersion(1)
.encryptionKey(/*my encryption key*/)
.name("pay_card.realm");
builder.addModule(new RPayCardRealmModule());
return Realm.getInstance(builder.build());
RPayCardRealmModule.class
@RealmModule(library = true,classes = {
RPayCard.class
})
public class RPayCardRealmModule {
}
RPayCard.class
@lombok.Getter
@lombok.Setter
@lombok.ToString(includeFieldNames = false)
@lombok.Builder
@lombok.AllArgsConstructor
@lombok.NoArgsConstructor
@lombok.EqualsAndHashCode(of = "id")
public class RPayCard extends RealmObject {
@io.realm.annotations.PrimaryKey
@io.realm.annotations.Required
String id;
private String billNumber;
private String cardNumber;
private String cardExpirationDate;
private String cardType;
private String cardHolderName;
private boolean selected;
}
But when I look into the db file "pay_card.realm".
It looks like that. Why other classes are added to db scheme? How to exclude them?
