Hi All,

What is the best practice in ivy to manage Enums in persistence classes ?

this example looks fine to me http://www.codejava.net/frameworks/hibernate/hibernate-enum-type-mapping-example

but how do I implemented in in ivy ? how to add @Enumerated to a field ?

Best Regards, Yordan Yunchov

asked 18.07.2016 at 08:58

Stelt0's gravatar image

Stelt0
186223038
accept rate: 20%


Setting a property like this is not supported by EntityClassEditor. The editor is built to create very simple JPA models.

If you hit a limitation of the editor like this @Enumerated property, you should break out of the editor and us a normal Java bean. Basically you can open the generated entity class of your existing EntityDataClass with the Java Editor and copy the generated source into the normal src directory. Then the EntityDataClass must be deleted... ... and of course now you are able to write whatever you want directly into the java source of the bean.

link

answered 18.07.2016 at 12:00

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
6.8k11238
accept rate: 70%

I have try it and it works fine. Both persisting and retrieving.

Thanks a lot for the tip !

BR, Yordan Yunchov

(18.07.2016 at 13:02) Stelt0 Stelt0's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×9
×6
×3

Asked: 18.07.2016 at 08:58

Seen: 457 times

Last updated: 18.07.2016 at 13:49