[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4417) Add annotation support for UserCollectionType

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 5 15:33:48 EST 2012


    [ https://hibernate.onjira.com/browse/HHH-4417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45838#comment-45838 ] 

Steve Ebersole commented on HHH-4417:
-------------------------------------

The only sticking point with auto determination (and IIUC this exists today in the annotation code anyway) is if you have something like:
{code:borderStyle=solid}
public class UniqueList implements java.util.Set, java.util.List {
    ...
}
{code}

If we need explicit specification of collection type (in the "Java type"/{{javax.persistence.metamodel.PluralAttribute.CollectionType}} sense) then I think:
* that should be a separate issue (again it exists in the old existing code before these changes as well)
* the solution should leverage org.hibernate.metamodel.domain.PluralAttributeNature, maybe exposed as an attribute on the {{org.hibernate.annotations.CollectionType}} annotation introduced by this issue, although TBH I think a separate annotation makes more sense.


> Add annotation support for UserCollectionType
> ---------------------------------------------
>
>                 Key: HHH-4417
>                 URL: https://hibernate.onjira.com/browse/HHH-4417
>             Project: Hibernate ORM
>          Issue Type: Patch
>          Components: annotations
>         Environment: All versions, database agnostic
>            Reporter: Douglas Sjoquist
>            Assignee: Steve Ebersole
>            Priority: Minor
>             Fix For: 4.1.1
>
>         Attachments: UserCollectionTypeAnnotation.zip
>
>   Original Estimate: 0.5h
>          Time Spent: 0.45h
>  Remaining Estimate: 0.5h
>
> Add an annotation to specify the UserCollectionType for a OneToMany or ManyToMany.
> The annotation is named CollectionTypeInfo, perhaps better named UserCollectionType, but I didn't know the standards for naming classes.
> The change to AnnotationBinder is minor and is delineated by '//dwsjoquist//'  comment lines.
> Usage:
>     @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
>     @JoinColumn(name = "id")
>     @CollectionTypeInfo(name = "examples.MyUserCollectionType")
>     public List<ExampleAttribute> getExampleAttributes() {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list