-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Middlegen fields changing order
PostPosted: Wed Feb 25, 2009 8:07 pm 
Newbie

Joined: Wed Feb 25, 2009 7:37 pm
Posts: 2
On my computer middlegen created the fields in one order, and on the other two developers machines it created them in a different order. To my knowledge we all had the same versions of elcipse, middlegen, tomcat, mysql and ant. So we ended up just having them run middlegen every time. Well now they have both quit so I'm trying to figure out if I can create the persistent objects in the same order, since all our code now relies on the constructors to be in order.

Does anyone know how middlegen determines the order of fields? Here is what the existing persistent objects look like. You can see that on the full constructor the order is different, container is in a different place. Any idea why that could be or how to change it?

/** identifier field */
private Integer containerId;

/** nullable persistent field */
private String containerLabel;

/** nullable persistent field */
private String fullnessStatus;

/** nullable persistent field */
private Double height;

/** nullable persistent field */
private Double width;

/** nullable persistent field */
private Double len;

/** nullable persistent field */
private Double weight;

/** nullable persistent field */
private Date cycleCountDateTime;

/** nullable persistent field */
private Date lastUpdateDateTime;

/** nullable persistent field */
private Integer lastUserId;

/** nullable persistent field */
private String lastSource;

/** persistent field */



private com.boxworks.wms.persist.Location location;

/** persistent field */
private com.boxworks.wms.persist.Warehouse warehouse;

/** persistent field */
private com.boxworks.wms.persist.OrderHeader orderHeader;

/** persistent field */
private com.boxworks.wms.persist.Container container;

/** persistent field */
private com.boxworks.wms.persist.ContainerType containerType;

/** persistent field */
private com.boxworks.wms.persist.Resource resource;

/** persistent field */
private Set worksByContainerId;

/** persistent field */
private Set worksByDestinationContainerId;

/** persistent field */
private Set inventories;

/** persistent field */
private Set containers;

/** full constructor */
public Container(String containerLabel, String fullnessStatus, Double height, Double width, Double len, Double weight, Date cycleCountDateTime, Date lastUpdateDateTime, Integer lastUserId, String lastSource, com.boxworks.wms.persist.Location location, com.boxworks.wms.persist.Warehouse warehouse, com.boxworks.wms.persist.OrderHeader orderHeader, com.boxworks.wms.persist.Container container, com.boxworks.wms.persist.ContainerType containerType, com.boxworks.wms.persist.Resource resource, Set worksByContainerId, Set worksByDestinationContainerId, Set inventories, Set containers) {
this.containerLabel = containerLabel;
this.fullnessStatus = fullnessStatus;
this.height = height;
this.width = width;
this.len = len;
this.weight = weight;
this.cycleCountDateTime = cycleCountDateTime;
this.lastUpdateDateTime = lastUpdateDateTime;
this.lastUserId = lastUserId;
this.lastSource = lastSource;

this.location = location;
this.warehouse = warehouse;


this.orderHeader = orderHeader;
this.container = container;
this.containerType = containerType;
this.resource = resource;
this.worksByContainerId = worksByContainerId;
this.worksByDestinationContainerId = worksByDestinationContainerId;
this.inventories = inventories;
this.containers = containers;
}


/************************
*************************
************************/
And here is what mine generates.




/** identifier field */
private Integer containerId;

/** nullable persistent field */
private String containerLabel;

/** nullable persistent field */
private String fullnessStatus;

/** nullable persistent field */
private Double height;

/** nullable persistent field */
private Double width;

/** nullable persistent field */
private Double len;

/** nullable persistent field */
private Double weight;

/** nullable persistent field */
private Date cycleCountDateTime;

/** nullable persistent field */
private Date lastUpdateDateTime;

/** nullable persistent field */
private Integer lastUserId;

/** nullable persistent field */
private String lastSource;

/** persistent field */
private com.boxworks.wms.persist.Container container;

/** persistent field */
private com.boxworks.wms.persist.Location location;

/** persistent field */
private com.boxworks.wms.persist.Warehouse warehouse;

/** persistent field */
private com.boxworks.wms.persist.Resource resource;

/** persistent field */
private com.boxworks.wms.persist.ContainerType containerType;

/** persistent field */
private com.boxworks.wms.persist.OrderHeader orderHeader;

/** persistent field */
private Set worksByDestinationContainerId;

/** persistent field */
private Set worksByContainerId;

/** persistent field */
private Set containers;

/** persistent field */
private Set inventories;




/** full constructor */
public Container(String containerLabel, String fullnessStatus, Double height, Double width, Double len, Double weight, Date cycleCountDateTime, Date lastUpdateDateTime, Integer lastUserId, String lastSource, com.boxworks.wms.persist.Container container, com.boxworks.wms.persist.Location location, com.boxworks.wms.persist.Warehouse warehouse, com.boxworks.wms.persist.Resource resource, com.boxworks.wms.persist.ContainerType containerType, com.boxworks.wms.persist.OrderHeader orderHeader, Set worksByDestinationContainerId, Set worksByContainerId, Set containers, Set inventories) {
this.containerLabel = containerLabel;
this.fullnessStatus = fullnessStatus;
this.height = height;
this.width = width;
this.len = len;
this.weight = weight;
this.cycleCountDateTime = cycleCountDateTime;
this.lastUpdateDateTime = lastUpdateDateTime;
this.lastUserId = lastUserId;
this.lastSource = lastSource;
this.container = container;
this.location = location;
this.warehouse = warehouse;
this.resource = resource;
this.containerType = containerType;
this.orderHeader = orderHeader;
this.worksByDestinationContainerId = worksByDestinationContainerId;


this.worksByContainerId = worksByContainerId;
this.containers = containers;
this.inventories = inventories;

}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2009 4:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If it is all the exact same version and you use the exact same settings then it should just work.

I would double check the versions..

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2009 7:20 pm 
Newbie

Joined: Wed Feb 25, 2009 7:37 pm
Posts: 2
Upgrading to the newest version of java (1.6) did the trick. Changing constructors for no apparent reason still makes me a little worried, but it works for now.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2009 9:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
my guess then is that in one of the layers of middlegen, jdbc driver and core collection libraries something has changed caused a dfference in order when you i.e. put things in a HashSet or similar...tricky business ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 08, 2009 7:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It surprises me (and in a way pleases me) that Middlegen is still being used. Glad all the effort is still benefiting some users out there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.