3

I have an existing Entity class that already inherits from another class, not model. The existing entity class comes from libraries (jar), that means that I can not change them.

Can I still use the CRUD approach of Play! Framework?

how can i do it?

thank you

user1167253
  • 813
  • 1
  • 11
  • 27

1 Answers1

0

from http://docs.oracle.com/javaee/5/tutorial/doc/bnbqa.html#bnbqr

Non-Entity Superclasses

Entities may have non-entity superclasses, and these superclasses can be either abstract or concrete. The state of non-entity superclasses is non-persistent, and any state inherited from the non-entity superclass by an entity class is non-persistent. Non-entity superclasses may not be used in EntityManager or Query operations. Any mapping or relationship annotations in non-entity superclasses are ignored.

I believe the only way is too have you super class annotated with @MappedSuperClass

Community
  • 1
  • 1
emt14
  • 4,846
  • 7
  • 37
  • 58
  • Sorry, but it's not an answer for my question – user1167253 Jan 30 '12 at 12:10
  • I assume you are talking about the crud module. You can use CRUD on your own class but since your super class is not part of the JPA model you won't be able to add crud support to it. you can add crud support to your base class though. http://www.playframework.org/documentation/1.2.4/guide7 – emt14 Jan 31 '12 at 06:54
  • Yes, i talking about the CRUD module. It is a pity, because the entity, that I have, come from the .jar, and can not change them. – user1167253 Jan 31 '12 at 15:27
  • Is there any chance you could decompile it and add annotations? – emt14 Feb 01 '12 at 06:58