[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-606) @Immutable does not throw error or warning on usage on subclass

Paul Benedict (JIRA) noreply at atlassian.com
Sun Apr 6 00:50:33 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29952 ] 

Paul Benedict commented on ANN-606:
-----------------------------------

Documentation needs further clarification. @Immutable is also allowed on a method/field. If it is applied with a @ManyToOne, is it saying the association is immutable (you can set it but not update it), or the target entity is immutable? Should be defined and also in the API.

> @Immutable does not throw error or warning on usage on subclass
> ---------------------------------------------------------------
>
>                 Key: ANN-606
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-606
>             Project: Hibernate Annotations
>          Issue Type: Improvement
>          Components: binder, documentation
>    Affects Versions: 3.3.0.ga
>         Environment: Hibernate3, Annotations.3.3.0
>            Reporter: Paul Singleton Kossler
>            Assignee: Emmanuel Bernard
>             Fix For: 3.3.1.beta1
>
>
> The @Immutable annotation does not throw a configuration error when used on a subclass.  The action required depends upon the decision in a bug/patch request for adding mutable=false to subclasses.   In the current rule set the Mapping Schema for pre annotations is leveraged to define the legallity of declaring a mapped object Immutable.  Base/Root classes allowed, child classes of Mutable=true not allowed, in either case the mutability of an object is directly dependent upon the mutability of the root mapped object in the object hierarchy.  
> The following documentation sources do not mention the issue in relation to the @Immutable annotation:
>    *  online/down-loadable Hibernate-Annotations
>    * Java Persistence with Hibernate (ISBN: 1-932394-88-5)
> If the rules outlined above are accurate or not:   A validation error or warning should be thrown from Configuration during the loading of an incorrectly mapped class.  The current method is to check the Annotations at bind time, and only at the "correct"  location.   This meta-rule validation should occur during the binding of a mapping to the Configuration, quickly indicating an error.  Using the "older" xml based mapping this occurs when the schema (xsd) validates the mapping file (xml).

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