[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-629) JSP fields out of order when using the Seam CRUD generator with annotated EJB3 entities

Sam Pullara (JIRA) noreply at atlassian.com
Sat Oct 25 13:51:05 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31530#action_31530 ] 

Sam Pullara commented on HBX-629:
---------------------------------

I was able to get around this issue by changing the Hibernate Annotation code, commenting out the part where it sorts them.  I don't know what effect this will have on native query support as the comment indicates that is why it is being done.

Index: src/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
--- src/java/org/hibernate/cfg/AnnotationBinder.java	(revision 15355)
+++ src/java/org/hibernate/cfg/AnnotationBinder.java	(working copy)
@@ -983,12 +983,12 @@
 		log.debug( "Processing " + propertyHolder.getEntityName() + " " + accessType + " annotation" );
 		List<XProperty> properties = annotatedClass.getDeclaredProperties( accessType );
 		//order so that property are used int he same order when binding native query
-		Collections.sort( properties, new Comparator<XProperty>() {
+/*		Collections.sort( properties, new Comparator<XProperty>() {
 			public int compare(XProperty property1, XProperty property2) {
 				return property1.getName().compareTo( property2.getName() );
 			}
 		} );
-		for ( XProperty p : properties ) {
+*/		for ( XProperty p : properties ) {
 			if ( !p.isTypeResolved() && !discoverTypeWithoutReflection( p ) && !mustBeSkipped( p, mappings ) ) {
 				throw new AnnotationException(
 						"Property " + StringHelper.qualify( propertyHolder.getEntityName(), p.getName() ) +




> JSP fields out of order when using the Seam CRUD generator with annotated EJB3 entities
> ---------------------------------------------------------------------------------------
>
>                 Key: HBX-629
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-629
>             Project: Hibernate Tools
>          Issue Type: Bug
>         Environment: The version of Hibernate and Hibernate Tools that is packaged with JBoss Seam 1.0 Beta 2
>            Reporter: Bruce Raggett
>            Priority: Minor
>             Fix For: 3.1.beta5
>
>
> If you use annotated EJB3 entities to generate a Seam CRUD application, then the generated JSPs are not really usable as the order of the fields in the generated JSPs is different from the order of the fields in the annotated EJB3 entities. This means that you have to manually edit the generated JSPs to get the fields into the correct order.
> This issue seems to exist whether the process used to generate the CRUD application is
> (a) generate a database schema from the annotated entities and then generate the CRUD application from the generated schema, or
> (b) generate the CRUD application directly from the annotated entities.

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