Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ebean how to exclude String as column

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;
}
like image 499
user1434177 Avatar asked Jun 28 '12 00:06

user1434177


1 Answers

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;
}
like image 57
niels Avatar answered Sep 19 '22 08:09

niels