Sqlite persist object containing collection of objects

98 views Asked by At

I keep getting an error when persisting an object in java with a collection of the same type of objects inside. Im using: OrmLite Sqlite

mi class is

@DatabaseTable(tableName="Profile") 
public class Profile {


/** the users username in the system */
@DatabaseField( unique = true)
private String usrName = null;

/** the users id */
@DatabaseField( generatedId = true)
private Integer usrId = null;

/** the users name */
@DatabaseField
private  String name = null;

/**the users friends*/
@ForeignCollectionField
private Collection<Profile> friends;

Am i forgetting to declare anything? I found something about foreign field, but i already set the id and the @foreigncollectionfield tag.

Supposedly a profile stores other profiles, but not necessarily the profiles stored have references to this profile.

Thanks for the answers! :)

0

There are 0 answers