[hibernate-dev] Another @Access quandry

Steve Ebersole steve at hibernate.org
Wed Apr 2 13:32:17 EDT 2014


To wrap up for now... I went ahead an implemented the strategies we
discussed here.  They are represented as:
1) org.hibernate.metamodel.spi.StandardPersistentAttributeMemberResolver
2) org.hibernate.metamodel.spi.LenientPersistentAttributeMemberResolver

StandardPersistentAttributeMemberResolver implements the JPA spec
guidelines as closely as possible.
 LenientPersistentAttributeMemberResolver tries to be more lenient in the
way Sanne mentioned above.  They will be pushed to master shortly if y'all
wanted to take a look.

Yes, MemberDescriptor and JavaTypeDescriptor are the reflite contracts




On Wed, Apr 2, 2014 at 6:34 AM, Hardy Ferentschik <hardy at hibernate.org>wrote:

>
> On 2 Jan 2014, at 04:20, Steve Ebersole <steve at hibernate.org> wrote:
>
> > I have heard no more comments, so I will move forward with this as
> stated earlier.
>
> Sorry for the late reply. I had a read through and what you describe is
> what I would expect (in fact I hope
> I basically implemented it this way on the metamodel branch).
>
> There is a typo in example 4:
>
> @Entity
> @Access(PROPERTY)
> public class PublishedDocument extends Document
>
> Should be @Access(FIELD)
>
>
> > Additionally, I started working the a PoC for the idea of making this
> resolution pluggable.  Here is the initial stroke for the contract:
> >
> >
> > /**
> >  * Contract responsible for resolving the members that identify the
> persistent
> >  * attributes for a given class descriptor representing a managed type.
> >  *
> >  * These members (field or method) would be where we look for mapping
> annotations
> >  * for the attribute.
> >  *
> >  * Additionally, whether the member is a field or method would tell us
> the default
> >  * runtime access strategy
> >  *
> >  * @author Steve Ebersole
> >  */
> > public interface PersistentAttributeMemberResolver {
> >       /**
> >        * Given the ManagedType Java type descriptor and the implicit
> AccessType
> >        * to use, resolve the members that indicate persistent attributes.
> >        *
> >        * @param managedTypeDescriptor The ManagedType Java type
> descriptor
> >        * @param implicitAccessType The implicit AccessType for the
> resolution
> >        *
> >        * @return The list of "backing members"
> >        */
> >       public List<MemberDescriptor> resolveMembers(
> >                       JavaTypeDescriptor managedTypeDescriptor,
> >                       AccessType implicitAccessType);
> > }
>
>
> Where MemberDescriptor and JavaTypeDescriptor are the descriptors from the
> new reflite layer, right?
> This should work.
>
> --Hardy
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list