I have a entity with following columns:
@Table(name="person")
public class Person {
@Id
@GeneratedValue
private int id;
private String name;
private String location;
@CreationTimestamp
private Date brithDate;
public Person() {
}
public Person(String name, String location, Date brithDate) {
this.name = name;
this.location = location;
this.brithDate = brithDate;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Date getBrithDate() {
return brithDate;
}
public void setBrithDate(Date brithDate) {
this.brithDate = brithDate;
}
@Override
public String toString() {
return "\nPerson [id=" + id + ", name= " + name + ", location= " + location + ", brithDate= " + brithDate + "]";
}
}
after the generation of table it produces columns as :
which is totally different than table generated by this query:
CREATE TABLE person(
id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL,
location VARCHAR(255),
birth_date TIMESTAMP,
PRIMARY KEY(id)
);
though I put the variables as same order in query. How to control this behavior of generation of table columns in alphabetical order?