I have a strange behavior. I have an entity which uses @Embeddables to store a type information (TerminalType). This types should have only fixed values. Therefore I created constants like CLIENT, BROWSER, EXTERNAL.
Code:
@Embeddable
@Audited
public class TerminalType extends DomainValue {
private static final long serialVersionUID = 1L;
public static final TerminalType CLIENT = new TerminalType("CLIENT");
public static final TerminalType BROWSER = new TerminalType("BROWSER");
public static final TerminalType EXTERNAL = new TerminalType("EXTERNAL");
protected TerminalType() {
}
protected TerminalType(String id) {
this.value = id;
}
@Column(name = "VALUE")
private String value;
/* getter and setter ... */
}
This class is then used in an entity Terminal
Code:
@Entity
@Audited
public class Terminal {
private static final long serialVersionUID = 1L;
@Id
protected String terminalName;
@NotNull
@Embedded
@AttributeOverride(name = "value", column = @Column(name = "TERMINAL_TYPE"))
protected TerminalType type;
protected Terminal() {
}
/* setter and getter ... */
}
The problem is that the values constants sometimes change. The application can run for hours, but after a while the constant CLIENT has the value "BROWSER".
I do not have any idea what/who changes the constant? Any idea will help!
Thanks!
We are using Hibernate 4.1.7.Final on Glassfish 3.1.2.2