/** * Stores information about auditing meta-data for the given class. * * @param pc Persistent class. * @param cad Auditing meta-data for the given class. */ public void addClassAuditingData(PersistentClass pc, ClassAuditingData cad) { entityNameToAuditingData.put( pc.getEntityName(), cad ); persistentClassToAuditingData.put( pc, cad ); }
@Override public String toString() { return getClass().getName() + '(' + getEntityName() + ')'; }
public void popEntityWorkedOn(PersistentClass persistentClass) { final PersistentClass stackTop = stackOfPersistentClassesBeingProcessed.remove( stackOfPersistentClassesBeingProcessed.size() - 1 ); if ( stackTop != persistentClass ) { throw new AssertionFailure( "Inconsistent popping: " + persistentClass.getEntityName() + " instead of " + stackTop.getEntityName() ); } }
public ClassPropertyHolder( PersistentClass persistentClass, XClass entityXClass, Map<String, Join> joins, MetadataBuildingContext context, Map<XClass, InheritanceState> inheritanceStatePerClass) { super( persistentClass.getEntityName(), null, entityXClass, context ); this.persistentClass = persistentClass; this.joins = joins; this.inheritanceStatePerClass = inheritanceStatePerClass; this.attributeConversionInfoMap = buildAttributeConversionInfoMap( entityXClass ); }
public DynamicMapInstantiator(PersistentClass mappingInfo) { this.entityName = mappingInfo.getEntityName(); isInstanceEntityNames.add( entityName ); if ( mappingInfo.hasSubclasses() ) { Iterator itr = mappingInfo.getSubclassClosureIterator(); while ( itr.hasNext() ) { final PersistentClass subclassInfo = ( PersistentClass ) itr.next(); isInstanceEntityNames.add( subclassInfo.getEntityName() ); } } }
public OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner) throws MappingException { super( buildingContext, table ); this.identifier = owner.getKey(); this.entityName = owner.getEntityName(); }
/** * @deprecated Use {@link OneToOne#OneToOne(MetadataBuildingContext, Table, PersistentClass)} instead. */ @Deprecated public OneToOne(MetadataImplementor metadata, Table table, PersistentClass owner) throws MappingException { super( metadata, table ); this.identifier = owner.getKey(); this.entityName = owner.getEntityName(); }
public boolean dependentUpon( CopyIdentifierComponentSecondPass other ) { return this.referencedEntityName.equals( other.component.getOwner().getEntityName() ); } }
public String getEntityName() { return collection.getOwner().getEntityName(); }
private Property getProperty(String propertyName, Iterator iterator) throws MappingException { if ( iterator.hasNext() ) { String root = StringHelper.root( propertyName ); while ( iterator.hasNext() ) { Property prop = (Property) iterator.next(); if ( prop.getName().equals( root ) ) { return prop; } } } throw new MappingException( "property [" + propertyName + "] not found on entity [" + getEntityName() + "]" ); }
/*package*/ void registerEntityType(PersistentClass persistentClass, EntityTypeImpl<?> entityType) { if ( ignoreUnsupported && entityType.getBindableJavaType() == null ) { return; } if ( entityType.getBindableJavaType() != null ) { entityTypes.put( entityType.getBindableJavaType(), entityType ); } entityTypesByEntityName.put( persistentClass.getEntityName(), entityType ); entityTypesByPersistentClass.put( persistentClass, entityType ); orderedMappings.add( persistentClass ); }
public static String getRelativePath(PropertyHolder propertyHolder, String propertyName) { if ( propertyHolder == null ) { return propertyName; } String path = propertyHolder.getPath(); String entityName = propertyHolder.getPersistentClass().getEntityName(); if ( path.length() == entityName.length() ) { return propertyName; } else { return StringHelper.qualify( path.substring( entityName.length() + 1 ), propertyName ); } }
public static BytecodeEnhancementMetadata from(PersistentClass persistentClass) { final Class mappedClass = persistentClass.getMappedClass(); final boolean enhancedForLazyLoading = PersistentAttributeInterceptable.class.isAssignableFrom( mappedClass ); final LazyAttributesMetadata lazyAttributesMetadata = enhancedForLazyLoading ? LazyAttributesMetadata.from( persistentClass ) : LazyAttributesMetadata.nonEnhanced( persistentClass.getEntityName() ); return new BytecodeEnhancementMetadataPojoImpl( persistentClass.getEntityName(), mappedClass, enhancedForLazyLoading, lazyAttributesMetadata ); }
private void checkPropertyDuplication() throws MappingException { HashSet<String> names = new HashSet<>(); Iterator iter = getPropertyIterator(); while ( iter.hasNext() ) { Property prop = (Property) iter.next(); if ( !names.add( prop.getName() ) ) { throw new MappingException( "Duplicate property mapping of " + prop.getName() + " found in " + getEntityName() ); } } }
private void processNamedEntityGraph(NamedEntityGraph annotation) { if ( annotation == null ) { return; } context.getMetadataCollector().addNamedEntityGraph( new NamedEntityGraphDefinition( annotation, name, persistentClass.getEntityName() ) ); }
public Property getRecursiveProperty(String propertyPath) throws MappingException { try { return getRecursiveProperty( propertyPath, getPropertyClosureIterator() ); } catch (MappingException e) { throw new MappingException( "property [" + propertyPath + "] not found on entity [" + getEntityName() + "]", e ); } }
@Override protected Instantiator buildInstantiator(EntityMetamodel entityMetamodel, PersistentClass persistentClass) { return new DynamicInstantiator( persistentClass.getEntityName() ); }
@Override protected Instantiator buildInstantiator(EntityMetamodel entityMetamodel, PersistentClass persistentClass) { return new MyEntityInstantiator( persistentClass.getEntityName() ); }
private void createForeignKeys() throws MappingException { // if ( !isInverse() ) { // for inverse collections, let the "other end" handle it if ( referencedPropertyName == null ) { getElement().createForeignKey(); key.createForeignKeyOfEntity( getOwner().getEntityName() ); } // } }
public void createForeignKey() { if ( !isJoinedSubclass() ) { throw new AssertionFailure( "not a joined-subclass" ); } getKey().createForeignKeyOfEntity( getSuperclass().getEntityName() ); }