private PersistentEntity getPersistentEntity(Class javaClass, MappingContext context, ClassMapping classMapping) { if (classMapping != null) { return classMapping.getEntity(); } return context.getPersistentEntity(javaClass.getName()); }
@Override public IdentityMapping createIdentityMapping(ClassMapping classMapping) { Map<String, T> props = entityToPropertyMap.get(classMapping.getEntity()); if (props != null) { T property = props.get(IDENTITY_PROPERTY); IdentityMapping customIdentityMapping = getIdentityMappedForm(classMapping,property); if (customIdentityMapping != null) { return customIdentityMapping; } } return super.createIdentityMapping(classMapping); }
public Property getMappedForm() { return classMapping.getEntity().getIdentity().getMapping().getMappedForm(); } };
public Property getMappedForm() { return classMapping.getEntity().getIdentity().getMapping().getMappedForm(); } };
public String[] getIdentifierName() { PersistentProperty identity = classMapping.getEntity().getIdentity(); String propertyName = identity != null ? identity.getMapping().getMappedForm().getName() : null; if(propertyName != null) { return new String[] { propertyName }; } else { return new String[] { IDENTITY_PROPERTY }; } }
@Override public IdentityMapping getIdentityMapping(final ClassMapping classMapping) { final PersistentEntity entity = classMapping.getEntity();
@Override public IdentityMapping createIdentityMapping(final ClassMapping classMapping) { final Mapping mappedForm = createMappedForm(classMapping.getEntity()); final Object identity = mappedForm.getIdentity(); final ValueGenerator generator; throw new DatastoreConfigurationException("Invalid id generation strategy for entity ["+classMapping.getEntity().getName()+"]: " + generatorName);