/** * Creates an accessor for the property of the embeddable class. */ protected Accessor createEmbeddableAccessor(EmbeddableDescriptor descriptor, String propertyName, Class<?> propertyType) { return new FieldAccessor(descriptor.getObjectClass(), propertyName, propertyType); }
/** * Creates an accessor for the property. */ protected Accessor createAccessor(PersistentDescriptor descriptor, String propertyName, Class<?> propertyType) throws PropertyException { return new FieldAccessor(descriptor.getObjectClass(), propertyName, propertyType); }
public FieldEmbeddableDescriptor(Embeddable embeddable, String ownerProperty, String embeddedPropertyProperty) { this.embeddable = embeddable; try { this.embeddableClass = Class.forName(embeddable.getClassName(), true, Thread .currentThread() .getContextClassLoader()); } catch (ClassNotFoundException e) { throw new PropertyException("Class not found", e); } this.ownerAccessor = new FieldAccessor( embeddableClass, ownerProperty, Persistent.class); this.embeddedPropertyAccessor = new FieldAccessor( embeddableClass, embeddedPropertyProperty, String.class); }