[jboss-jira] [JBoss JIRA] (HIBERNATE-59) @OneToMany collection is not filled when it should when the PK is of uniqueidentifier
Steve Ebersole (JIRA)
issues at jboss.org
Thu Nov 19 10:17:01 EST 2015
[ https://issues.jboss.org/browse/HIBERNATE-59?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole closed HIBERNATE-59.
-----------------------------------
Resolution: Rejected
> @OneToMany collection is not filled when it should when the PK is of uniqueidentifier
> -------------------------------------------------------------------------------------
>
> Key: HIBERNATE-59
> URL: https://issues.jboss.org/browse/HIBERNATE-59
> Project: Hibernate Integration
> Issue Type: Bug
> Environment: Windows XP SP2
> JBoss 4.2 CR1
> SQL Server 2000
> Reporter: Tobias Bergman
> Assignee: Steve Ebersole
> Priority: Critical
>
> I have found a problem when using uniqueidentifier as PK and FK.
> A collection which should have entires are empty. The same code will have a non-empty collections when tested on glassfish.
> import javax.persistence.*;
> import java.util.List;
> @Entity
> @Table(name = "A")
> public class A
> {
> @Id
> @Column(name = "Id")
> private String mId;
> @OneToMany(mappedBy = "mA")
> private List<B> mBList;
> //Getter and setters to the members...
> }
> @Entity
> @Table(name = "B")
> public class B
> {
> @Id
> @Column(name = "Id")
> private String mId;
> @ManyToOne
> @JoinColumn(name = "AId")
> private A mA;
> //Getter and setters to the members...
> }
> When the db type is an uniqueidentifier the mBList list is not filled! If the db type is changed to a string the List is filled correctly.
> But it works with uniqueidentifier when the entity is merged (when creating a new entity A and some B's).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list