5

So I have the below code. Where I am trying to create a table called SecurityType which has values ID and description. I would like to add two strings "Administrator" and "user" to it. Is there a way I can exclude these two from being columns in the ebean table? or do I need to move to another class?

@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;
}
user1434177
  • 1,947
  • 4
  • 26
  • 40

1 Answers1

19

Make them transient:

@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;
}
niels
  • 7,321
  • 2
  • 38
  • 58