[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-361) HA takes metadata from IdClass rather than the entity itself

Thomas Risberg (JIRA) noreply at atlassian.com
Mon Oct 30 16:41:05 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-361?page=comments#action_25032 ] 

Thomas Risberg commented on ANN-361:
------------------------------------

Just a follow-up on this.  If I use orm.xml - how would I specify the column names on the @IdClass?  I can't find a corresponding xml entry for this id class - there is an <id--class> on the entity side, but nothing on the actual id class side - am I missing something?  The only solution I found was to make the id class embeddable, but that seems like a workaround rather than the solution.

> 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