Skip to content

Commit

Permalink
Just correcting some formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jpav committed Mar 2, 2012
1 parent 47c5e4c commit 8f01023
Showing 1 changed file with 22 additions and 57 deletions.
Expand Up @@ -150,9 +150,7 @@ public class Binder {

private final HibernateTypeHelper typeHelper; // todo: refactor helper and remove redundant methods in this class

public Binder(
final MetadataImplementor metadata,
final IdentifierGeneratorFactory identifierGeneratorFactory ) {
public Binder( final MetadataImplementor metadata, final IdentifierGeneratorFactory identifierGeneratorFactory ) {
this.metadata = metadata;
this.identifierGeneratorFactory = identifierGeneratorFactory;
nameNormalizer = new ObjectNameNormalizer() {
Expand Down Expand Up @@ -244,8 +242,7 @@ private BasicAttributeBinding bindBasicAttribute(
return attributeBinding;
}

private void bindBasicElementSetTablePrimaryKey(
final SetBinding attributeBinding ) {
private void bindBasicElementSetTablePrimaryKey( final SetBinding attributeBinding ) {

final PrimaryKey primaryKey = attributeBinding.getCollectionTable().getPrimaryKey();
final ForeignKey foreignKey = attributeBinding.getPluralAttributeKeyBinding().getForeignKey();
Expand Down Expand Up @@ -484,9 +481,7 @@ private CompositeAttributeBinding bindComponentAttribute(
return attributeBinding;
}

private void bindDiscriminator(
final EntityBinding rootEntityBinding,
final RootEntitySource rootEntitySource ) {
private void bindDiscriminator( final EntityBinding rootEntityBinding, final RootEntitySource rootEntitySource ) {
final DiscriminatorSource discriminatorSource = rootEntitySource.getDiscriminatorSource();
if ( discriminatorSource == null ) {
return;
Expand Down Expand Up @@ -519,8 +514,7 @@ private void bindDiscriminator(
resolveHibernateResolvedType( hibernateTypeDescriptor, typeName, value );
}

private EntityBinding bindEntities(
final EntityHierarchy entityHierarchy ) {
private EntityBinding bindEntities( final EntityHierarchy entityHierarchy ) {
final RootEntitySource rootEntitySource = entityHierarchy.getRootEntitySource();
// Return existing binding if available
EntityBinding rootEntityBinding = metadata.getEntityBinding( rootEntitySource.getEntityName() );
Expand Down Expand Up @@ -555,8 +549,7 @@ private EntityBinding bindEntities(
return rootEntityBinding;
}

public void bindEntities(
final Iterable< EntityHierarchy > entityHierarchies ) {
public void bindEntities( final Iterable< EntityHierarchy > entityHierarchies ) {
entitySourcesByName.clear();
attributeSourcesByName.clear();
inheritanceTypes.clear();
Expand All @@ -574,9 +567,7 @@ public void bindEntities(
}
}

private EntityBinding bindEntity(
final EntitySource entitySource,
final EntityBinding superEntityBinding ) {
private EntityBinding bindEntity( final EntitySource entitySource, final EntityBinding superEntityBinding ) {
// Return existing binding if available
EntityBinding entityBinding = metadata.getEntityBinding( entitySource.getEntityName() );
if ( entityBinding != null ) {
Expand Down Expand Up @@ -619,9 +610,7 @@ private void bindHibernateTypeDescriptor(
resolveHibernateResolvedType( hibernateTypeDescriptor, typeName, value );
}

private void bindIdentifier(
final EntityBinding rootEntityBinding,
final IdentifierSource identifierSource ) {
private void bindIdentifier( final EntityBinding rootEntityBinding, final IdentifierSource identifierSource ) {
final Nature nature = identifierSource.getNature();
if ( nature == Nature.SIMPLE ) {
bindSimpleIdentifier( rootEntityBinding, ( SimpleIdentifierSource ) identifierSource );
Expand Down Expand Up @@ -734,9 +723,7 @@ private AbstractPluralAttributeBinding bindPluralAttribute(
return attributeBinding;
}

private void bindPrimaryTable(
final EntityBinding entityBinding,
final EntitySource entitySource ) {
private void bindPrimaryTable( final EntityBinding entityBinding, final EntitySource entitySource ) {
entityBinding.setPrimaryTable( createTable( entitySource.getPrimaryTable(), new DefaultNamingStrategy() {

@Override
Expand All @@ -746,9 +733,7 @@ public String defaultName() {
} ) );
}

private void bindSecondaryTables(
final EntityBinding entityBinding,
final EntitySource entitySource ) {
private void bindSecondaryTables( final EntityBinding entityBinding, final EntitySource entitySource ) {
final TableSpecification primaryTable = entityBinding.getPrimaryTable();
for ( final SecondaryTableSource secondaryTableSource : entitySource.getSecondaryTables() ) {
final TableSpecification table = createTable( secondaryTableSource.getTableSource(), null );
Expand Down Expand Up @@ -803,9 +788,7 @@ private AbstractPluralAttributeBinding bindSetAttribute(
null );
}

private void bindSimpleIdentifier(
final EntityBinding rootEntityBinding,
final SimpleIdentifierSource identifierSource ) {
private void bindSimpleIdentifier( final EntityBinding rootEntityBinding, final SimpleIdentifierSource identifierSource ) {
final BasicAttributeBinding idAttributeBinding =
( BasicAttributeBinding ) bindAttribute( rootEntityBinding, identifierSource.getIdentifierAttributeSource() );
rootEntityBinding.getHierarchyDetails().getEntityIdentifier().setValueBinding( idAttributeBinding );
Expand Down Expand Up @@ -860,17 +843,13 @@ private void bindSortingAndOrdering(
}
}

private void bindSubEntities(
final EntityBinding entityBinding,
final EntitySource entitySource ) {
private void bindSubEntities( final EntityBinding entityBinding, final EntitySource entitySource ) {
for ( final SubclassEntitySource subEntitySource : entitySource.subclassEntitySources() ) {
bindEntity( subEntitySource, entityBinding );
}
}

private void bindUniqueConstraints(
final EntityBinding entityBinding,
final EntitySource entitySource ) {
private void bindUniqueConstraints( final EntityBinding entityBinding, final EntitySource entitySource ) {
for ( final ConstraintSource constraintSource : entitySource.getConstraints() ) {
if ( constraintSource instanceof UniqueConstraintSource ) {
final TableSpecification table = entityBinding.locateTable( constraintSource.getTableName() );
Expand Down Expand Up @@ -928,9 +907,7 @@ private List< RelationalValueBinding > bindValues(
return valueBindings;
}

private void bindVersion(
final EntityBinding rootEntityBinding,
final VersionAttributeSource versionAttributeSource ) {
private void bindVersion( final EntityBinding rootEntityBinding, final VersionAttributeSource versionAttributeSource ) {
if ( versionAttributeSource == null ) {
return;
}
Expand Down Expand Up @@ -973,9 +950,7 @@ private Column createColumn(
return column;
}

private EntityBinding createEntityBinding(
final EntitySource entitySource,
final EntityBinding superEntityBinding ) {
private EntityBinding createEntityBinding( final EntitySource entitySource, final EntityBinding superEntityBinding ) {
final LocalBindingContext bindingContext = entitySource.getLocalBindingContext();
bindingContexts.push( bindingContext );
try {
Expand Down Expand Up @@ -1059,18 +1034,15 @@ private EntityBinding createEntityBinding(
}
}

private Identifier createIdentifier(
String name,
final String defaultName ) {
private Identifier createIdentifier( String name, final String defaultName ) {
if ( StringHelper.isEmpty( name ) ) {
name = defaultName;
}
name = quotedIdentifier( name );
return Identifier.toIdentifier( name );
}

private void createIdentifierGenerator(
final EntityBinding rootEntityBinding ) {
private void createIdentifierGenerator( final EntityBinding rootEntityBinding ) {
final Properties properties = new Properties();
properties.putAll( metadata.getServiceRegistry().getService( ConfigurationService.class ).getSettings() );
if ( !properties.contains( AvailableSettings.PREFER_POOLED_VALUES_LO ) ) {
Expand Down Expand Up @@ -1153,8 +1125,7 @@ private TableSpecification createTable(
inLineViewSource.getSelectStatement() );
}

private EntityBinding entityBinding(
final String entityName ) {
private EntityBinding entityBinding( final String entityName ) {
// Check if binding has already been created
EntityBinding entityBinding = metadata.getEntityBinding( entityName );
if ( entityBinding == null ) {
Expand All @@ -1174,8 +1145,7 @@ private EntityBinding entityBinding(
return entityBinding;
}

private void mapSourcesByName(
final EntitySource entitySource ) {
private void mapSourcesByName( final EntitySource entitySource ) {
entitySourcesByName.put( entitySource.getEntityName(), entitySource );
for ( final AttributeSource attributeSource : entitySource.attributeSources() ) {
attributeSourcesByName.put( attributeSource.getName(), attributeSource );
Expand All @@ -1185,8 +1155,7 @@ private void mapSourcesByName(
}
}

private PluralAttributeElementNature pluralAttributeElementNature(
final PluralAttributeSource attributeSource ) {
private PluralAttributeElementNature pluralAttributeElementNature( final PluralAttributeSource attributeSource ) {
return PluralAttributeElementNature.valueOf( attributeSource.getElementSource().getNature().name() );
}

Expand All @@ -1210,15 +1179,13 @@ private SingularAttributeBinding pluralAttributeKeyBinding(
return ( SingularAttributeBinding ) referencedAttributeBinding;
}

private String propertyAccessorName(
final AttributeSource attributeSource ) {
private String propertyAccessorName( final AttributeSource attributeSource ) {
return attributeSource.getPropertyAccessorName() == null
? bindingContexts.peek().getMappingDefaults().getPropertyAccessorName()
: attributeSource.getPropertyAccessorName();
}

private String quotedIdentifier(
final String name ) {
private String quotedIdentifier( final String name ) {
return bindingContexts.peek().isGloballyQuotedIdentifiers() ? StringHelper.quote( name ) : name;
}

Expand All @@ -1242,9 +1209,7 @@ private void resolveHibernateResolvedType(
}
}

private boolean toBoolean(
final TruthValue truthValue,
final boolean truthValueDefault ) {
private boolean toBoolean( final TruthValue truthValue, final boolean truthValueDefault ) {
if ( truthValue == TruthValue.TRUE ) {
return true;
}
Expand Down

0 comments on commit 8f01023

Please sign in to comment.