There is a duplication for my question but not yet answered. I'm a beginner to hibernate, while creating table automatically from entity in SQL Server using the property
<property name="hibernate.hbm2ddl.auto">create</property>
it seems the order of table column is not correct that was not an issue for me until i used composite key. Now the issue is the order of the column is not as same the business entity. Here is the business entity i created
@Entity
public class SalesEstimateDtl implements Serializable {
@Id
private Long LedSalesEstID;
@Id
private Integer LedSalesEstRowNo;
and here is the generated query
CREATE TABLE [dbo].[SalesEstimateDtl](
[LedSalesEstRowNo] [int] NOT NULL,
[LedSalesEstID] [numeric](19, 0) NOT NULL,
PRIMARY KEY CLUSTERED
(
[LedSalesEstRowNo] ASC,
[LedSalesEstID] ASC
) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
How can i change the order of LedSalesEstRowNo with LedSalesEstID?