[Hibernate-JIRA] Created: (ANN-551) @SQLInsert. Columns in sql comes in different order depending on the application server used
by Søren Pedersen (JIRA)
@SQLInsert. Columns in sql comes in different order depending on the application server used
--------------------------------------------------------------------------------------------
Key: ANN-551
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-551
Project: Hibernate Annotations
Type: Bug
Components: binder
Versions: 3.2.1
Environment: Hibernate-core 3.2.2, hibernate-annotations 3.2.1. WebLogic 9.2 and JBoss 4.0.5. Oracle 10.
Reporter: Søren Pedersen
Problem:
The columns in the sql you specify in SQLInsert annotation has be ordered in the same way hibernate sorts its properties when constructing the insert sql.
Example:
When WebLogic 9.2 is used the sql should look like this:
"insert into acount (name, address, country) values (?,?,?)"
But when JBoss 4.0.5 is used the sql should look like this:
"insert into acount (address, country, name) values (?,?,?)"
The above are only examples.
Consequence:
I have to have different SQLInsert's for every JEE apllication server we support, because the properties comes in different order depending on the application server used.
Suggested solution:
In the method org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(List<PropertyData> elements, PropertyHolder propertyHolder, boolean isPropertyAnnotated,String propertyAccessor, final XClass annotatedClass, ExtendedMappings mappings)
This property list shown below should be sorted to make sure that the properties also come in the same order:
List<XProperty> properties = annotatedClass.getDeclaredProperties( accessType );
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 9 months
[Hibernate-JIRA] Created: (HHH-2617) Warning on tables with inheritance when table defaults are set in entity-mappings
by Stephen Todd (JIRA)
Warning on tables with inheritance when table defaults are set in entity-mappings
---------------------------------------------------------------------------------
Key: HHH-2617
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2617
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.2
Environment: Using Annotations
Reporter: Stephen Todd
Priority: Trivial
Attachments: inheritance-orm.xml, TestSingleTableInheritanceWarnings.java
The following warning message is logged when entity-mapping defaults are set and tables with inheritance are present:
Illegal use of @Table in a subclass of a SINGLE_TABLE hierarchy: class.name.Here
I attached a test case that recreates the problem. Basically, the error occurs when a resource contains persistence-unit-defaults. It appears that hibernate creates an @Table attribute for every registered entity when I think it should only do it for non-single table inheritance entities. Below is an example of the orm.xml
<entity-mappings>
<persistence-unit-metadata>
<persistence-unit-defaults>
<catalog>public</catalog>
</persistence-unit-defaults>
</persistence-unit-metadata>
<entity class="hibernatebugs.TestAnnotationWarnings$ParentEntity">
<inheritance strategy="SINGLE_TABLE"/>
</entity>
</entity-mappings>
Test requires EasyMock and Log4J.
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months