-
1. Re: Issues with relationships between tables
asookazian Jul 9, 2009 11:20 PM (in response to lhyna)You need to be much more specific with more details.
How exactly did you do your revengr? I usually use seam generate-entities from cmd line. I do not use SAF, so no EntityHome or EntityQuery, etc. I prefer a clean revengr and then use SMPC with Hibernate Manual flush for all my SFSBs.
What RDBMS are you using? If you're using SQL SERVER, then you will need to instruct hbm2java (part of Hibernate Tools to revengr your data model) to add the @GeneratedValue annotation for IDENTITY columns.
And what exactly did you do to generate that error? Was that via the EntityManager API to persist a new entity into the table?
-
2. Re: Issues with relationships between tables
lhyna Jul 10, 2009 12:27 AM (in response to lhyna)Hi!
I did revengr using jboss developer studio from a RDBMS MySQL. I couldn't do revengr from cmd because the issue in My Link. Maybe that wasn't an issue at all. :$
The revengr works fine, it creates all the classes and the relations between tables, but the table persona has many relationships with the table cte (because cte is the table in which almost all the values that may appear at comboboxes are) and many relationships with the table dvp (table of states and cities), and persona (people) has the city wher him/her live, where was born and many others.
The problem seems to be related to the fact that the same bean is used to modify, add the relationships between persona form and cte form.
Thanks,
-
3. Re: Issues with relationships between tables
lhyna Jul 10, 2009 4:36 PM (in response to lhyna)I just realize that in the file PersonaHome.java located at org.domain.sigee.entity has been built as follow
package org.domain.sigee.entity; import java.util.ArrayList; import java.util.List; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Name; import org.jboss.seam.framework.EntityHome; @Name("personasHome") public class PersonasHome extends EntityHome<Personas> { @In(create = true) CtesHome ctesHome; @In(create = true) CtesHome ctesHome; @In(create = true) CtesHome ctesHome; @In(create = true) DvpsHome dvpsHome; @In(create = true) DvpsHome dvpsHome; @In(create = true) DvpsHome dvpsHome; @In(create = true) CtesHome ctesHome;...
And the issue is related at the instance names, so I changed it to
package org.domain.sigee.entity; import java.util.ArrayList; import java.util.List; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Name; import org.jboss.seam.framework.EntityHome; @Name("personasHome") public class PersonasHome extends EntityHome<Personas> { @In(create = true) CtesHome ctesHome1; @In(create = true) CtesHome ctesHome2; @In(create = true) CtesHome ctesHome3; @In(create = true) DvpsHome dvpsHome; @In(create = true2) DvpsHome dvpsHome; @In(create = true) DvpsHome dvpsHome3; @In(create = true) CtesHome ctesHome4;...
But isn't that simple, does it? (I tried to change to almost all the code at PersonaHome where I find ctesHome ) now I'm getting this error
18:22:27,175 ERROR [application] javax.faces.el.EvaluationException: org.jboss.seam.RequiredException: In attribute requires non-null value: personasHome.ctesHome2 javax.faces.el.EvaluationException: javax.faces.el.EvaluationException: org.jboss.seam.RequiredException: In attribute requires non-null value: personasHome.ctesHome2
Anywhere else the code has to be changed?