1

I have a question about "annotations" in hibernate. I have a BaseEntity class and another class like state.java who extend

 @JsonIgnoreProperties({ "hibernateLazyInitializer", "handler", "createdBy", "updatedBy" })
    @MappedSuperclass

public abstract class BaseEntity<T> implements Serializable {


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private T                   id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CreatedBy", nullable = true)
    private User                createdBy;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "UpdatedBy", nullable = true)
    private User                updatedBy;

    @Column(name = "createdDate", nullable = true, updatable = false)
    private Date                createdDate;

    @Column(name = "UpdatedDate", nullable = true)
    private Date                updatedDate;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "subsite", nullable = true)
    private Subsite             subsite;

    @Column(name = "ip", nullable = true)
    private String              ip;


@Entity
@Table(name="State")
public class State extends BaseEntity<Long> {

    @Column(name = "state", nullable = true)
    private String  state;

    @Column(name = "city", nullable = true)
    private String  city;

when program creat my tables in DataBase my table'design build like this:

enter image description here

How can I create a table so that the BaseEntity'fields place after state'fields in my Table

DimaSan
  • 12,264
  • 11
  • 65
  • 75
  • Might be a duplicate of : http://stackoverflow.com/questions/1298322/wrong-ordering-in-generated-table-in-jpa – ST-DDT Oct 25 '16 at 07:30

0 Answers0