[hibernate-issues] [Hibernate-JIRA] Created: (ANN-845) @CollectionOfElements not using @Where clause to manage collection

Clay Atkins (JIRA) noreply at atlassian.com
Sun Jun 21 09:15:35 EDT 2009


@CollectionOfElements not using @Where clause to manage collection
------------------------------------------------------------------

                 Key: ANN-845
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-845
             Project: Hibernate Annotations
          Issue Type: Bug
    Affects Versions: 3.3.1.GA
         Environment: Oracle10g
            Reporter: Clay Atkins


Here is my sample:

{code}
    @CollectionOfElements()
    @JoinTable(name = "DEAL_MSR", joinColumns=@JoinColumn(name = "DEAL_ID"))
    @Where(clause="DATA_TYPE_CD='B'")
    @IndexColumn(name = "REL_PRD_NUM", nullable = false)
    private List<BBB> periodBaseProjections;

    @CollectionOfElements()
    @JoinTable(name = "DEAL_MSR", joinColumns=@JoinColumn(name = "DEAL_ID"))
    @Where(clause="DATA_TYPE_CD='I'")
    @IndexColumn(name = "REL_PRD_NUM", nullable = false)
    private List<III> periodIncrementalProjections;
{code}

The primary key for table DEAL_MSR is DEAL_ID, DATA_TYPE_CD and REL_PRD_NUM. Each @CollectionOfElements needs to map a subset of the rows related through the DEAL_ID. The @Where clause is not used when inserting or updating the table. Maybe this is the wrong syntax or the wrong approach or maybe something is broken.

I do want to use @CollectionOfElements so that the associated data is an embedded attribute with a lifecycle bound to the single entity if possible.

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