Hi Matt,

  presently i'm working with appfuse 2.0 (struts2) application. i have one
problem how to use composite primary key using hibernate in this application

 My model class code like this
@IdClass (value=MenuPk.class)
@Entity 
@Table (name="App_Menu")
public class Menu extends BaseObject implements java.io.Serializable {
  @Id
  @Column (name="MenuID",nullable=false)
  private Long id;
  
  @Id
  @ManyToOne (targetEntity=Product.class)
  @JoinColumn (name="Product_ID")
  private Product product;

  .............

}

public class MenuPk extends BaseObject implements Serializable {
  private Long id;
  private Product product;

  ...........
}

the IdClass changes are done after run the mvn appfuse:gen -Dentity=Menu

it compiles and runs perfectly, but when i need to access the list in web
page it throws an exception(Data Failure Exception page )

in the server console it shows 
sql column error "id" column not existed 
sql column error "product" column not existed 

My database data is like this


MenuID   Product_ID .....

  1            1    .......
  2            1    ....... 
  3            1    .......
  1            2    .......
  2            2    .......
  3            2    .......

please suggest me how to solve this problem ( it is an urgent requirement to
me)

-----
---
Sudhakar
-- 
View this message in context: 
http://www.nabble.com/Composite-primary-key-problem-in-appfuse-2.0-%28struts2%29-tp25506686s2369p25506686.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to