On Feb 9, 2012, at 12:30 PM, Aristedes Maniatis wrote: >> Hi all, I was quite new with Cayenne, how can I do this : >> >> Book extends _Book >> >> public static final String DESCRIPTION_PROPERTY = "description"; >> public static final String ID_BOOK_PROPERTY = "idBook"; >> public static final String LEVEL_PROPERTY = "level"; >> public static final String PATH_PROPERTY = "path"; >> public static final String STATUS_PROPERTY = "status"; >> public static final String TITLE_PROPERTY = "title"; >> .... >> >> How can I get the information of field (title, "title" , String ) which >> inside CayenneObject , or I have to write the inspector by my own? ( There >> some bean inspector library but I think Cayenne done that already, and other >> hack will be ugly )... > > There is a little ant task called cgen which creates the getters and setters > for you. > > http://cayenne.apache.org/doc/ant-tasks.html
Also in runtime, you have access to ObjEntity object that contains all the entity ORM metadata. Book myBook = ... ObjEntity e = context.getEntityResolver().lookupObjEntity(myBook); Andrus