|
|
Re: Controlling column order when creating tables with ddl-generation [message #735928 is a reply to message #388423] |
Thu, 13 October 2011 06:50 |
Boyd Pang Messages: 12 Registered: June 2011 |
Junior Member |
|
|
Hello James,
In my application,I define an entity class and a class implements DescriptorCustomizer,
@Entity
@Table(name = "adapter")
@Customizer(OrderCustomizer.class)
public class AdapterRecord implements Comparable<AdapterRecord>, Serializable
{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String name;
private int serialNum;
private boolean isRunnig;
private String serverIp;
@Temporal(TemporalType.TIMESTAMP)
private Date startTime;
private int test;
private int test1;
private int ptest;
private String pIp;
private String sIp;
private int aTest;
......
}
public class OrderCustomizer implements DescriptorCustomizer
{
@Override
public void customize(ClassDescriptor descriptor)
{
descriptor.setShouldOrderMappings(false);
}
}
I want the columns in a particular order - the order in which the
fields appear in the Entity class definition.
But when I run the application ,I got columns order :
starttime,
id,
atest,
test1,
test,
name,
serverip,
isrunning,
serialnum,
pIp,
ptest,
sip
Could you give me some help ? Thanks a lot.
Boyd
-
Attachment: columns.JPG
(Size: 51.96KB, Downloaded 872 times)
[Updated on: Thu, 13 October 2011 06:56] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01621 seconds