Please use the new forum: http://groups.google.com/group/fornax-platform/


Chrismic wrote:
> 
> Hi all,
> 
> I have defined an enum in my model file as follows:<br><br>
> <br>
> --
> <br>
> "Enum denoting the visibility of a recipients address when a message is
> sent to one or more recipients"<br>
>         enum AddressingVisibility {<br>
>             String code key<br>
>             TO ("to"),<br>
>             CC ("cc"),<br>
>             BCC ("bcc")<br>
>         }<br>
> <br>
> --<br>
> <br>
> I have a reference to this enum in one of my entities:<br>
> <br>
> --<br><br>
> <br>
>    "The Message Entity"<br>
>         Entity Message {<br>
> <br>
>             .<br>
>             .<br>
>             - @AddressingVisibility addressVisibility nullable<br>
>             .<br>
>             .<br>
>      }<br>
> <br>
> --<br><br>
> <br>
> 
> My code is generated properly and the project compiles without any errors.
> However, when I run my tests I get the following error:<br>
> <br>
> <br>
> --<br>
> <br>
> Caused by: org.hibernate.MappingException: Could not determine type for:
> AddressingVisibility, at table: MESSAGE, for columns:
> [org.hibernate.mapping.Column(ADDRESSVISIBILITY)]<br>
>       at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:292)<br>
>       at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)<br>
>       at org.hibernate.mapping.Property.isValid(Property.java:207)<br>
>       at
> org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)<br>
>       at org.hibernate.mapping.RootClass.validate(RootClass.java:215)<br>
>       at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)<br>
>       at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)<br>
>       at
> org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)<br>
>       at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)<br>
>       ... 58 more<br>
> <br>
> --<br><br>
> <br>
> I have checked the files generated and all seems well ...
> applicationContext-test.xml has a reference to
> EntityManagerFactory-test.xml which has a reference to
> persistence-test.xml which has a reference to hibernate.cfg.xml which
> contains a reference to the EnumsXXXX.hbm.xml which contains the
> definitions of my Enums. PS: The problem I am having is with all enums
> (tried removing the one mentioned here ...). The enum giving the error
> happens to be the very first one to be 'started'.<br><br>
> 
> Something else, which is quite weird is that these same tests work when I
> run them from within my IDE (IntelliJ). (They fail when I run 'mvn clean
> install').<br><br>
> 
> <br><br>
> Thanks for any help ...<br>
> <br>
> Regards<br>
> Chris<br>
> 

-- 
View this message in context: 
http://old.nabble.com/Hibernate-MappingException-for-Enums.-tp29965294s17564p29971399.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to