jpa - Why the list of a object returned from hibernate is empty? -
well, i'm here again. in project work, have faced problem, sametimes solve way it. in manytomany relationship, don't know make it. when use find method of entitymanager , it's returned object, , if object has list of other objects, list come empty when saved object filled list.
the classes:
public class equipecategoria { @id @generatedvalue(strategy= generationtype.identity) private integer id; private esexo sexo; private ecategoria categoria; @manytoone(cascade = cascadetype.all) @cascade(org.hibernate.annotations.cascadetype.delete_orphan) private equipe equipe; @onetoone(cascade = cascadetype.all) @cascade(org.hibernate.annotations.cascadetype.delete_orphan) private equipejogo equipejogo; @manytomany(cascade = cascadetype.all) @cascade(org.hibernate.annotations.cascadetype.delete_orphan) private list<dirigente> dirigentes; @onetomany(cascade = cascadetype.all) @cascade(org.hibernate.annotations.cascadetype.delete_orphan) private list<atleta> atletas; @manytoone private modalidade modalidade; @manytoone private prova prova; // getters , setters }
and
public class dirigente { @id @generatedvalue(strategy= generationtype.identity) private integer id; private string doc_prof; private string nome; private efuncao funcao; // efuncao @manytomany(cascade = cascadetype.all) @cascade(org.hibernate.annotations.cascadetype.delete_orphan) private list<equipecategoria> equipes; @manytoone private equipe equipe; // getters , setters }
what can do?
Comments
Post a Comment