所以我有以下代码。我正在尝试创建一个名为SecurityType的表,其中包含值ID和描述。我想在其中添加两个字符串“Administrator”和“user”。有没有办法可以将这两个排除在ebean表中的列之外?还是我需要搬到另一个班级?
@Entity
public class SecurityType extends Model {
public static final String ADMIN = "Administrator";
public static final String USER = "User";
@Id
public Long id;
public String description;
}
答案 0 :(得分:19)
让它们变得短暂:
@Entity
public class SecurityType extends Model {
@Transient
public static final transient String ADMIN = "Administrator";
@Transient
public static final transient String USER = "User";
@Id
public Long id;
public String description;
}