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

Paul Singleton Kossler (JIRA) noreply at atlassian.com
Fri Apr 27 11:33:04 EDT 2007


Annotation Validation:  @Immutable annotation 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: Bug
          Components: binder, documentation
    Affects Versions: 3.3.0.ga
         Environment: Hibernate3, Annotations.3.3.0

            Reporter: Paul Singleton Kossler


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