我想知道Hibernate注释

时间:2016-10-25 07:17:32

标签: java hibernate

我有一个关于"注释"的问题在休眠。  我有一个BaseEntity类和另一个像state.java这样扩展

的类
 @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;

当程序在DataBase中创建我的表时,我的表&#39;设计构建如下:

enter image description here

如何创建表格,以便BaseEntity&#39;字段放在我的表格中的州&#39;字段之后

0 个答案:

没有答案