This content has been marked as final.
Show 2 replies
-
1. Re: Is possible to mapping my Etities by annotaions?
luizsync Jul 6, 2010 2:14 PM (in response to luizsync)Sorry!
I forgot to show my sample:
@Entity public class Group implements Serializable { @ManyToMany( targetEntity=Permission.class, cascade={CascadeType.PERSIST, CascadeType.MERGE} ) @JoinTable( name="Group_Permission", joinColumns={@JoinColumn(name="groupid")}, inverseJoinColumns={@JoinColumn(name="permissionid")} ) public Collection getPermissions() { return teste; } ... } @Entity public class Permission implements Serializable { @ManyToMany( cascade={CascadeType.PERSIST, CascadeType.MERGE}, mappedBy="teste" targetEntity=Group.class ) public Collection getGroups() { return groups; } }
-
2. Re: Is possible to mapping my Etities by annotaions?
herberson Jul 12, 2010 9:37 PM (in response to luizsync)The answer: YES! Is possible and recommended.