查找ColumnDefinition枚举或常量

时间:2013-11-01 15:47:37

标签: java hibernate postgresql jpa constants

我正在寻找一个包含JPA columnDefinition的常量或枚举的类。

例如:

public class MyEntity {

    @JoinColumn(name = "my_value", columnDefinition = "BIGINT")
    private Integer myValue;

    // some code...
}

我想替换这个:

"BIGINT" -> ColumnDefinition.BIGINT

我正在使用JPA / Hibernate和PostgreSQL。

1 个答案:

答案 0 :(得分:1)

  1. 您可以使用某些类似public static final String BIGINT="BIGINT"的字段定义类。
  2. 或者,将postgres JDBC驱动程序添加到类路径中,并检查是否找到了任何内容。
相关问题