Ebean how to exclude String as column
Asked Answered
S

1

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;
}
Steere answered 28/6, 2012 at 0:59 Comment(0)
H
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;
}
Herminahermine answered 28/6, 2012 at 9:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.