java - android ormlite issue with database field foreign its becaume null when i retrieve them from database -


Hi sorry for everyone and my english.

I have a big problem that I can not understand. I create a table with the ORMLITE which contains a foreign field in the same table. I insert it, but when I retrieve it, it is always empty.

  @DatabaseTable (tabnname = "menu") public class MenuDo {personal constant last string MENU_PARENT = "menu_parent"; / ** ID Unique Dances La Base de DONEY * / @ DATABASEFIELD (Generated = true, exclusive = true) Private Long ID; / ** le gabarit du sous menu Save WS * / @DatabaseField (canBeNull = true, columnName = "gabarit") private string gabarit; / ** Click on the menu with LE label or WS * / @DatabaseField (canBeNull = true, columnName = "label") Private string label; / ** URL de la redirection generator redirection wai list objects DN Rubberic * / @dbasefield (canBeNull = true, columnName = "url") Private string URL; / ** Le name de la rabrick du la item dew menu * / @ database field (canBeNull = true, columnName = "rubrique_id") Private string rubric ID; / ** Click on the Les Asus menu menu menu * / @ DatabaseField (foreign = true, column name = menu.d.mnurpRR) private menuDown menu; }  

I enter this way

  enter the public zero (the last list  menuDo) throws SQLException {configurationRepository = new ConfigurationRepositoryImpl (Context); TransactionManager.callInTransaction (configurationRepository.getConnectionSource), new callable & lt; Object & gt; () {@Override Public Object Call ()) Exception {deleteAll () for Menu (Menu: MenuDow) {insert (menu);} return null;}}); }  

Method to insert the database:

  @ Override enter the public zero (C unit) {if (unit! = Zero) {if (abstractRunTimeExceptionDao Create (unit) == 0) {throw the new technical exception (INSERT_ERROR_MESSAGE + entity.toString ()); }}}  

There is no error in the insertion and I already verify that the parent menu is not taped before the menu entry

but < Code> Menu is always empty when I retrieve the elements from the database.

Thank you for your response.


Comments