greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

@ToMany Can't the associated field be a string type? #1117

Closed zpswz closed 3 hours ago

zpswz commented 3 days ago

@ToMany(referencedJoinProperty = "p_fid") private List imageList;

p_fid type is string

error log Long cannot be converted to String List imageListNew = targetDao._queryDirectoryBean_ImageList(id);

The automatically generated code is queried directly with the id

greenrobot-team commented 3 hours ago

The referencedJoinProperty needs to point to the @Id of the targeted entity. See https://greenrobot.org/greendao/documentation/relations/ for details and examples.