[hibernate-issues] [Hibernate-JIRA] Updated: (ANN-361) HA takes metadata from IdClass rather than the entity itself
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Fri Aug 25 16:54:24 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-361?page=all ]
Emmanuel Bernard updated ANN-361:
---------------------------------
Summary: HA takes metadata from IdClass rather than the entity itself (was: @Column(name="xxxx") does not work when composit key is used)
> HA takes metadata from IdClass rather than the entity itself
> ------------------------------------------------------------
>
> Key: ANN-361
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-361
> Project: Hibernate Annotations
> Type: Bug
> Versions: 3.2.0.cr1
> Reporter: Thomas Risberg
>
>
> When using a composit key and specifying name of id column - the specified name is ignored and a column with the name of the field is generated.
> This:
> -------------
> import java.io.Serializable;
> public class ProductItemPK implements Serializable {
> private Long productId;
> private Long itemId;
> }
> -------------
> import javax.persistence.*;
> @Entity
> @IdClass(value=ProductItemPK.class)
> public class ProductItem {
> @Id
> @Column(name="product_id")
> private Long productId;
> @Id
> @Column(name="item_id")
> private Long itemId;
> private String name;
> }
> -------------
> results in:
> create table ProductItem (
> productId number(19,0) not null,
> itemId number(19,0) not null,
> name varchar2(255 char),
> primary key (productId, itemId)
> )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list