When generating PrimeFaces Pages from Entity Classes no many to many relationships were generated until I noticed in your videos that you were using the @JoinTable annotation. I prefer to avoid too many redundant annotations, both for code readability and for avoiding mistakes. It would be nice if PrimeFaces CRUD would get this info without the @JoinTable annotation and just with the @ManyToMany annotation.
Thanks and keep up the good work! :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Schifazl. You are referring to the Entity classes, which are generated separately from the CRUD pages using NetBeans' Entity Classes from Database wizard. I am also using NetBeans' internal API to make some determinations about such entities. So I am tied to whatever NetBeans does.
Last edit: Kay Wrobel 2013-11-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just found out that during entity generation, if you click on the check box for "Use defaults where possible", the @JoinColumn annotation doesn't get generated. Try it out.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Scratch that!@JoinTable still gets generated. Though I think that NetBeans put it inside the wrong class. In my case, NetBeans put the JoinTable annotation inside the Characteristic class and not inside the Customer class. That is a problem because now, the CRUD generator puts selection list on the Characteristic screens (Create,Edit). That is not where I think they should belong. They should be on the Customer entity. Wouldn't you agree?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, they should be in the Customer entity, but I'm not generating Entities from DB schema, but the other way around. So in my case this isn't an issue because I'm choosing the owning side. It's just an annoyance to write the extra @JoinTable in addition to the @ManyToMany annotation.
I hope I was clear :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When generating PrimeFaces Pages from Entity Classes no many to many relationships were generated until I noticed in your videos that you were using the @JoinTable annotation. I prefer to avoid too many redundant annotations, both for code readability and for avoiding mistakes. It would be nice if PrimeFaces CRUD would get this info without the @JoinTable annotation and just with the @ManyToMany annotation.
Thanks and keep up the good work! :)
Hi Schifazl. You are referring to the Entity classes, which are generated separately from the CRUD pages using NetBeans' Entity Classes from Database wizard. I am also using NetBeans' internal API to make some determinations about such entities. So I am tied to whatever NetBeans does.
Last edit: Kay Wrobel 2013-11-04
OK, never mind :)
I just found out that during entity generation, if you click on the check box for "Use defaults where possible", the
@JoinColumnannotation doesn't get generated. Try it out.Scratch that!
@JoinTablestill gets generated. Though I think that NetBeans put it inside the wrong class. In my case, NetBeans put the JoinTable annotation inside the Characteristic class and not inside the Customer class. That is a problem because now, the CRUD generator puts selection list on the Characteristic screens (Create,Edit). That is not where I think they should belong. They should be on the Customer entity. Wouldn't you agree?Yes, they should be in the Customer entity, but I'm not generating Entities from DB schema, but the other way around. So in my case this isn't an issue because I'm choosing the owning side. It's just an annoyance to write the extra @JoinTable in addition to the @ManyToMany annotation.
I hope I was clear :)