memtrip / SQLKing

SQLKing is an Android SQLite ORM powered by an annotation preprocessor, tables are defined by Table annotations and CRUD classes expose an expressive api for executing SQLite queries. @memtrip
Other
21 stars 9 forks source link

Foreign Key annotation syntax #8

Open Trellian opened 8 years ago

Trellian commented 8 years ago

Hi Sam, thanks a mill for the 1.0.6 release. I have a new problem now:

in one of my tables, I have the following:

`@Table public class TblMapVisitor2Entry extends ScanTableBase implements Parcelable {

@Column(index = true, foreign_key = "TblEntry")
private int     entry_fk;
@Column private int entry_reason;   // E_ENTRY_REASON

` and it generates the following error:

error: [A @Column with a foreign_key can only annotate a variable whose data type is annotated with @Table]

What is the correct way to do this? Please note, that all of my tables extend from ScanTableBase, which looks like this:

`@Table public class ScanTableBase { // Fields common to all tables @Column protected int id; @Column protected int synch_status;

@Column protected long        synch_date;       // Last good synch date
@Column protected boolean     deleted;
...
 }

` Perhaps this is rocking the boat a bit?

Thanks, Adrian

samkirton commented 8 years ago

Foreign keys are not supported at the moment, I am developing them as part of the next release