openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Annotations removed when enhancing?
Date Wed, 08 Aug 2012 13:55:06 GMT
>  What way of enhancement do you use in your project?
>  If you use subclassing, then the generated subclass is probably without
annotations.

And, if you are using subclassing, then quit using subclassing!  :-)
Nobody that is serious about their application should be using subclassing
support.  I've even been throwing around the idea of removing the
subclassing support altogether since it can cause more issues than it
resolves...  But, that's a whole separate discussion...

Kevin

On Wed, Aug 8, 2012 at 1:13 AM, Mark Struberg <struberg@yahoo.de> wrote:

>
>
> Kevin is right. I re-checked it now as well. At least for build-time
> enhanced entities the annotations remain on the class and fields. We do not
> use method annotations, so I cannot check this quickly.
>
> What confused me earlier is that jad (java decompiler) doesn't seem to
> show annotations in general. But looking at the hex dump of the class file
> itself clearly shows that they are there.
>
> What way of enhancement do you use in your project?
> If you use subclassing, then the generated subclass is probably without
> annotations.
>
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Kevin Sutter <kwsutter@gmail.com>
> > To: users@openjpa.apache.org
> > Cc:
> > Sent: Tuesday, August 7, 2012 5:21 PM
> > Subject: Re: Annotations removed when enhancing?
> >
> > I'm curious why you think that the annotations are removed...  Even after
> > enhancement is performed, OpenJPA parses the entity classes to get the
> ORM
> > data, which is normally specified via annotations.  Do you have an
> example?
> >
> > Kevin
> >
> > On Sun, Aug 5, 2012 at 1:09 PM, Chris Joysn <joysn71@gmail.com> wrote:
> >
> >>  well.. unfortunately a framework relies on it to detect JPA
> entities... i
> >>  think there is no other way to detect in a reliable way JPA entities?
> >>
> >>  LieGrueZuRue
> >>
> >>
> >>  On 5 August 2012 19:52, Mark Struberg <struberg@yahoo.de> wrote:
> >>
> >>  > Having code relying on @Entity is bitter so to say ;)
> >>  >
> >>  > All JPA functions could also be added via XML, without having any
> >>  > annotation on your entities...
> >>  >
> >>  > Such code would btw also not work in Hibernate if you use proxies.
> >>  Becasue
> >>  > the generated proxies don't have annotations neither.
> >>  >
> >>  > LieGrue,
> >>  > strub
> >>  >
> >>  >
> >>  >
> >>  > ----- Original Message -----
> >>  > > From: Chris Joysn <joysn71@gmail.com>
> >>  > > To: users@openjpa.apache.org
> >>  > > Cc:
> >>  > > Sent: Sunday, August 5, 2012 7:19 PM
> >>  > > Subject: Annotations removed when enhancing?
> >>  > >
> >>  > > Hello,
> >>  > >
> >>  > > is it possible that entities do not get their annotations removed
> > when
> >>  > > OpenJPA is performing its enhancements?
> >>  > >
> >>  > > unfortunately some code relies on the fact that eg. @Entity is
> > present
> >>  on
> >>  > > classes, but this annotation gets removed by OpenJPA.
> >>  > >
> >>  > > thanks
> >>  > >
> >>  >
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message