提交 ca3e9b75 编写于 作者: C Calvin

测试Oracle兼容性,需要另行实现,后见wiki

上级 73a58e62
......@@ -9,7 +9,7 @@ import javax.persistence.MappedSuperclass;
* 统一定义id的entity基类.
*
* 基类统一定义id的属性名称、数据类型、列名映射及生成策略.
* 子类可重载getId()函数重定义id的列名映射和生成策略.
* Oracle需要每个Entity独立定义id的SEQUCENCE时,不继承于本类而改为实现一个Idable的接口。
*
* @author calvin
*/
......@@ -21,9 +21,6 @@ public abstract class IdEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
//@GeneratedValue(strategy = GenerationType.SEQUENCE)
//@GeneratedValue(generator = "system-uuid")
//@GenericGenerator(name = "system-uuid", strategy = "uuid")
public Long getId() {
return id;
}
......
......@@ -34,6 +34,7 @@ public class Task extends IdEntity {
this.description = description;
}
//基于USER_ID列的多对一关系定义
@ManyToOne
@JoinColumn(name = "USER_ID")
public User getUser() {
......
......@@ -13,7 +13,6 @@ import org.hibernate.validator.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.ImmutableList;
//JPA标识
@Entity
@Table(name = "SS_USER")
public class User extends IdEntity {
......
......@@ -5,15 +5,6 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
/**
* 统一定义id的entity基类.
*
* 基类统一定义id的属性名称、数据类型、列名映射及生成策略.
* 子类可重载getId()函数重定义id的列名映射和生成策略.
*
* @author calvin
*/
//JPA Entity基类的标识
@MappedSuperclass
public abstract class IdEntity {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册