-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate @Embeddable static final
PostPosted: Wed Sep 10, 2014 6:36 am 
Newbie

Joined: Wed Sep 10, 2014 6:34 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.