[jboss-user] [JBoss Seam] - Re: seam-gen : reverse DB : many-to-many convention ?

2007-12-18 Thread damienhuriet
 
  Hello,

Thanks for the reply, but it "seams" to do.
Indeed, I've managed to generate a many-to-many relationship with seam-gen 
between two tables NAME1 and NAME2:
 
The many-to-many relationship table should:
- its name should be "NAME1_NAME2"
- it has the right to have only 2 columns : a double primary key relying on the 
two foreignKey columns : FK1 and FK2 named as you want but with reference 
integrity constraints towards the primary key of the two tables : NAME1 and 
NAME2.

It has generated me the getters and setters of the list in each entity NAME1 
and NAME2 : 

Expl : 

- The class NAME1 contains the function "public Set getName2s()" and its 
setter 

and 

- The class NAME2 contains the function "public Set getName1s()" and its 
setter

and no entity has been generated for the table "NAME1_NAME2", that is right 
because it is a "utility table" and not a table reflecting a "business objet" 
to be persisted.

The hibernate relationship has been created also : 


  | @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  | @JoinTable(name = "NAME1_NAME2", catalog = "mycatalogname", joinColumns 
= { @JoinColumn(name = "NAME1_ID", nullable = false, updatable = false) }, 
inverseJoinColumns = { @JoinColumn(name = "NAME2_ID", nullable = false, 
updatable = false) })
  | public Set getName2s() {
  | return this.name2s;
  | }
  | 
  | public void setName2s(Set name2s) {
  | this.name2s = name2s;
  | }
  | 

I still have a problem in the following step : 

As the returned list is of type java.util.Set and not java.util.List, I do not 
(for the moment) manage to display this list in a rich:datatable : 


  | 
  | 
  | id
  | #{name2s.id}
  | 
  | 

Caused by javax.servlet.ServletException with message: "/Name1Edit.xhtml: 
Property 'id' not found on type org.hibernate.collection.PersistentSet" 
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)


Caused by javax.el.ELException with message: "/Name1Edit.xhtml: Property 'id' 
not found on type org.hibernate.collection.PersistentSet" 
com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)


If anyone can help me on this point.

   Thanks,

  Damien


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114098#4114098

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114098
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - seam-gen : reverse DB : many-to-many convention ?

2007-12-14 Thread damienhuriet
Hi ! 

I'm trying to find the convention to use so that seam-gen generates a 
many-to-many relationship. 

I'm using seam 2.0 in Eclipse Europa and JBossTools. 
My DB is in MySQL 5.0. 
The wizards to "generate entities" from an existing DB works very well. 

I'have understood that there is a convention to name the link table to preform 
the many-to-many relationship between two other tables, 
but I could not find a precise description of it. 

What name should I give to this link table ? 
Is there other thing than the name to do ? 

Thanks in advance ! 
And thanks JBoss and all the contributers for their great job about Seam ! 
It rocks ! 

Damien 


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113074#4113074

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113074
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - seam-gen : reverse-engineering DB : convention to define man

2007-12-14 Thread damienhuriet
 Hi !

I'm trying to find the convention to use so that seam-gen generates a 
many-to-many relationship.

I'm using seam 2.0 in Eclipse Europa and JBossTools.
My DB is in MySQL 5.0.
The wizards to "generate entities" from an existing DB works very well.

I'have understood that there is a convention to name the link table to preform 
the many-to-many relationship between two other tables, 
but I could not find a precise description of it.

What name should I give to this link table ?
Is there other thing than the name to do ?

Thanks in advance !
And thanks JBoss and all the contributers for their great job about Seam !
It rocks !

Damien



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113072#4113072

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113072
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user