On Thu, Apr 1, 2010 at 10:56 AM, sapatel [via OpenJPA] <
[email protected]<ml-node%[email protected]>
> wrote:

> What I want to do is I want all my JPA entities to extend some BaseEntity
> class where can I define some properites (which are not table columns) to
> use/share.


Just do it:

public class A {
  // no matter what you put in here it won't be mapped to the database,
  // even if you use JPA annotations.
}

@Entity
public class B extends A {
  // All state and behavior is available from A.  Only fields defined in B
that are
  // annotated with JPA annotations will get mapped to the database.
}

(If you want some of A's state to be mapped, then you want to look at the
@MappedSuperclass annotation, but that is not what you are claiming you want
from your question.)

Best,
Laird

-- 
View this message in context: 
http://n2.nabble.com/can-JPA-Entity-extend-non-JPA-Entity-tp4837568p4837820.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to