[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2837) Collections not getting loaded when an entity has a string primary key. This is observed only for Sql Server 2005. Works fine with My-Sql.

Diego Pires Plentz (JIRA) noreply at atlassian.com
Thu Nov 1 10:40:29 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28662 ] 

Diego Pires Plentz commented on HHH-2837:
-----------------------------------------

Please, attach a runnable testcase (java+mapping).

Time frame? Well, if you send a testcase + patch it could be very fast :-)

> Collections not getting loaded when an entity has a string primary key. This is observed only for Sql Server 2005. Works fine with My-Sql.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-2837
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2837
>             Project: Hibernate3
>          Issue Type: Bug
>    Affects Versions: 3.2.5
>         Environment: Hibernate 3.2.5 . Microsoft Sql Server 2005. Data direct database driver for Sql Server 2005
>            Reporter: zoharat bhiwandiwala
>         Attachments: MySql.txt, SqlServer2005.txt
>
>
> We have an entity called Batch, which holds a collection of BatchMember entities in it. 
> Batch has a primary key of type string.
> When we load the Batch entity from Microsoft Sql server 2005, only the batch entity data is returned. The batch members collection is always empty. Which is incorrect as there are batch members associated with it.
> This test works fine when we load the batch from My Sql server.
> When I changed the Batch entities primary key to a long the batch members were retrieved from both the databases.
> The test's produce the same result  for FetchType.EAGER or  FetchType.LAZY.
> Attached are the hibernate sql which get generated. 
> Kindly observe the one for Sql Server 2005 with primary key as string . It runs 3 queries, the third one gets rid of the batchmembers . That does not happen when the primary key is of type integer.

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