/** * Adds the AttributeConverter Class to this Configuration. * * @param attributeConverterClass The AttributeConverter class. * @param autoApply Should the AttributeConverter be auto applied to property types as specified * by its "entity attribute" parameterized type? */ public void addAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass, boolean autoApply) { addAttributeConverter( AttributeConverterDefinition.from( attributeConverterClass, autoApply ) ); }
public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass) { //Ejb3Column.checkPropertyConsistency( ); //already called earlier if ( columns != null && columns[0].isSecondary() ) { //TODO move the getJoin() code here? final Join join = columns[0].getJoin(); addPropertyToJoin( prop, declaringClass, join ); } else { addProperty( prop, declaringClass ); } }
/** * useful to override a column either by @MapsId or by @IdClass */ Ejb3Column[] buildExcplicitOrDefaultJoinColumn(PropertyData overridingProperty) { Ejb3Column[] result; result = buildExplicitJoinColumns( overridingProperty.getProperty(), overridingProperty ); if (result == null) { result = buildDefaultJoinColumnsForXToOne( overridingProperty.getProperty(), overridingProperty); } return result; } }
private Configuration buildBaseConfiguration() { return new Configuration() .addResource( "org/hibernate/test/stats/Continent.hbm.xml" ) .setProperty( AvailableSettings.GENERATE_STATISTICS, "true" ); } //
@Override public void configure(Configuration cfg) { cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "false"); cfg.setProperty(Environment.GENERATE_STATISTICS, "true"); }
public String collectionTableName( String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName ) { return tableName( ownerEntityTable + '_' + propertyToColumnName(propertyName) ); }
public static String getReferenceEntityName(PropertyData propertyData, MetadataBuildingContext buildingContext) { XClass targetEntity = getTargetEntity( propertyData, buildingContext ); if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
@Override public Column[] getOverriddenColumn(String propertyName) { //FIXME this is yukky Column[] result = super.getOverriddenColumn( propertyName ); if ( result == null ) { String userPropertyName = extractUserPropertyName( "id", propertyName ); if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName ); } if ( result == null ) { String userPropertyName = extractUserPropertyName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY, propertyName ); if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName ); } return result; }
@Override public boolean isCollectionElement() { // if the propertyHolder is a collection, assume the // @Column refers to the element column return !propertyHolder.isComponent() && !propertyHolder.isEntity(); }
@Override public <S extends X> SubGraphImplementor<S> makeSubGraph(Class<S> subType) { throw new NotYetImplementedException( ); } }
/** * must only be used on second level phases (<join> has to be settled already) */ public static PropertyHolder buildPropertyHolder( PersistentClass persistentClass, Map<String, Join> joins, MetadataBuildingContext context, Map<XClass, InheritanceState> inheritanceStatePerClass) { return new ClassPropertyHolder( persistentClass, null, joins, context, inheritanceStatePerClass ); } }
AbstractPropertyHolder( String path, PropertyHolder parent, XClass clazzToProcess, MetadataBuildingContext context) { this.path = path; this.parent = (AbstractPropertyHolder) parent; this.context = context; buildHierarchyColumnOverride( clazzToProcess ); }
/** * Overridden to reliably pass a {@link CurrentTenantIdentifierResolver} to the SessionFactory. * @since 4.3.2 * @see AvailableSettings#MULTI_TENANT_IDENTIFIER_RESOLVER */ @Override public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) { getProperties().put(AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolver); super.setCurrentTenantIdentifierResolver(currentTenantIdentifierResolver); }
public void configure(Configuration cfg) { cfg.setProperty( Environment.USE_SECOND_LEVEL_CACHE, "true" ); cfg.setProperty( Environment.USE_QUERY_CACHE, "true" ); cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); }
/** * Adds the AttributeConverter Class to this Configuration. * * @param attributeConverterClass The AttributeConverter class. */ public void addAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass) { addAttributeConverter( AttributeConverterDefinition.from( attributeConverterClass ) ); }
@Override public void configure(Configuration cfg) { cfg.setProperty( Environment.HBM2DDL_IMPORT_FILES, "/org/hibernate/test/fileimport/humans.sql,/org/hibernate/test/fileimport/dogs.sql" ); }
/** * Adds the AttributeConverter instance to this Configuration. This form is mainly intended for developers * to programmatically add their own AttributeConverter instance. HEM, instead, uses the * {@link #addAttributeConverter(Class, boolean)} form * * @param attributeConverter The AttributeConverter instance. * @param autoApply Should the AttributeConverter be auto applied to property types as specified * by its "entity attribute" parameterized type? */ public void addAttributeConverter(AttributeConverter attributeConverter, boolean autoApply) { addAttributeConverter( AttributeConverterDefinition.from( attributeConverter, autoApply ) ); }
@Override protected void configure(Configuration cfg) { cfg.setProperty( "hibernate.cache.use_query_cache", "true" ); } }
/** * Adds the AttributeConverter instance to this Configuration. This form is mainly intended for developers * to programmatically add their own AttributeConverter instance. HEM, instead, uses the * {@link #addAttributeConverter(Class, boolean)} form * * @param attributeConverter The AttributeConverter instance. */ public void addAttributeConverter(AttributeConverter attributeConverter) { addAttributeConverter( AttributeConverterDefinition.from( attributeConverter ) ); }
@Override protected void configure(Configuration configuration) { configuration.setProperty( AvailableSettings.USE_SECOND_LEVEL_CACHE, "false" ); configuration.setProperty( AvailableSettings.ENABLE_LAZY_LOAD_NO_TRANS, "true" ); }