Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Question about @BasicCollection and Primary Key

Hi Daniel,

Unfortunately not at the present time no, but feel free to log an enhancement bug.

Cheers,
Guy

----- Original Message ----- From: <Daniel.Stucky@xxxxxxxxxxx>
To: <eclipselink-users@xxxxxxxxxxx>
Sent: Wednesday, January 28, 2009 12:14 PM
Subject: [eclipselink-users] Question about @BasicCollection and Primary Key


Given the following Entity

@Entity
@Table(name = "ATTRIBUTES")
public class AttributeDao {

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO)
 @Column(name = "ATT_ID")
 private String _id;

 @Column(name = "ATT_NAME")
 private String _name;

 @BasicCollection (
   fetch=FetchType.EAGER,
   valueColumn=@Column(name="ATT_VALUE"))
   @CollectionTable (
       name="ATTRIBUTE_VALUES",
       primaryKeyJoinColumns=
       {@PrimaryKeyJoinColumn(name="ATT_ID",
referencedColumnName="ATT_ID")}
   )
 private List<String> _values;
}

For _vales the following DDL is used to create the table:
CREATE TABLE "ATTRIBUTE_VALUES" ("ATT_ID" VARCHAR2(255) NOT NULL ENABLE,
"ATT_VALUE" VARCHAR2(255))

Is it somehow possible to define the following Primary Key definition
via annotations ?
PRIMARY KEY ("ATT_ID", "ATT_VALUE")

Bye,
Daniel
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top