[hibernate-issues] [Hibernate-JIRA] Created: (HCANN-7) Hibernate interprets relation as embedding

Lucius Gregory Meredith (JIRA) noreply at atlassian.com
Mon Jun 22 18:12:33 EDT 2009


Hibernate interprets relation as embedding
------------------------------------------

                 Key: HCANN-7
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-7
             Project: Hibernate Commons Annotations
          Issue Type: Bug
    Affects Versions: 3.2
         Environment: Mac OS X (leopard); Java 1.5 or 1.6; MySQL, HSQLDB
            Reporter: Lucius Gregory Meredith


Hibernate interprets JPA annotations

@Entity
...
public class ... {
...
@OneToOne
@JoinColumn
<MethodDecl>

...}

as indication to embed the referenced entity, rather than use the key.

For code sample see http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate

Instructions for use:

i included the target dir in the repo to speed up investigation, but you can just blow that away and build from scratch. The example is currently written to Java1.6, but also exhibits the same behavior under Java1.5. To run the example

> svn co http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
...
> env PATH=<path-to-java1.6>:$PATH JAVA_HOME=<path-to-java1.6> mvn clean compile process-classes

If you switch comment and decl at line 22 in src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error. The schema goes from

create table lingo_production.MySampleFuContainer_table (
        id_AbstractContainer varchar(255) not null,
        varchar(255) not null,
        uuid varchar(255),
        mysamplingmumble__idSuper varchar(255),
        primary key (id),
        unique (uuid)
    );

to

create table lingo_production.MySampleFuContainer_table (
        id_AbstractContainer varchar(255) not null,
        id varchar(255),
        mysamplingmumble_ tinyblob,
        uuid varchar(255),
        primary key (id_AbstractContainer),
        unique (id_AbstractContainer)
    );



-- 
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