我有两个实体:
第一个是:
public class WordEntity {
@PrimaryKey
private String content;
private int wordId;
}
第二个是:
public class LexiconEntity {
@SecondaryKey(relate = Relationship.ONE_TO_ONE, relatedEntity = WordEntity.class)// it does not work
private int wordId;
private int numDocs;
}
我想wordId
成为LexiconEntity
的外键WordEntity
。我怎样才能做到这一点?