I have got a question about primarykey-mapping.

Having two tables:

t_customer
---------------
int | customer_id (PK)
varchar | firstname
varchar | lastname

t_friendship
---------------
int | customer_id (PK)
int | friend_customer_id (PK)
date | created


Is it possible to map this two tables to the following class-structure using 
annotations ?

class Customer
{
    public Long getId() {...}
    public String getFirstname() {...}
    public String getLastname() {...}
}

class Friendship
{
    public Customer getCustomer() {...}
    public Customer getFriend() {...}
    public Date getCreated() {...}
}


The "Customer"-class is not the problem, but I am simply unable to declare 
"getCustomer() & getFriend()" as compound primary-key of class "Friendship".


Any help would be appreciated

Regards
Jan

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921569


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to