Just correcting some formatting issues
This commit is contained in:
parent
ec2450bf21
commit
47c5e4c535
|
@ -150,7 +150,8 @@ public class Binder {
|
||||||
|
|
||||||
private final HibernateTypeHelper typeHelper; // todo: refactor helper and remove redundant methods in this class
|
private final HibernateTypeHelper typeHelper; // todo: refactor helper and remove redundant methods in this class
|
||||||
|
|
||||||
public Binder( final MetadataImplementor metadata,
|
public Binder(
|
||||||
|
final MetadataImplementor metadata,
|
||||||
final IdentifierGeneratorFactory identifierGeneratorFactory ) {
|
final IdentifierGeneratorFactory identifierGeneratorFactory ) {
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
this.identifierGeneratorFactory = identifierGeneratorFactory;
|
this.identifierGeneratorFactory = identifierGeneratorFactory;
|
||||||
|
@ -169,7 +170,8 @@ public class Binder {
|
||||||
typeHelper = new HibernateTypeHelper( this, metadata );
|
typeHelper = new HibernateTypeHelper( this, metadata );
|
||||||
}
|
}
|
||||||
|
|
||||||
private AttributeBinding bindAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private AttributeBinding bindAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final AttributeSource attributeSource ) {
|
final AttributeSource attributeSource ) {
|
||||||
// Return existing binding if available
|
// Return existing binding if available
|
||||||
final String attributeName = attributeSource.getName();
|
final String attributeName = attributeSource.getName();
|
||||||
|
@ -183,31 +185,33 @@ public class Binder {
|
||||||
return bindPluralAttribute( attributeBindingContainer, ( PluralAttributeSource ) attributeSource );
|
return bindPluralAttribute( attributeBindingContainer, ( PluralAttributeSource ) attributeSource );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindAttributes( final AttributeBindingContainer attributeBindingContainer,
|
private void bindAttributes(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final AttributeSourceContainer attributeSourceContainer ) {
|
final AttributeSourceContainer attributeSourceContainer ) {
|
||||||
for ( final AttributeSource attributeSource : attributeSourceContainer.attributeSources() ) {
|
for ( final AttributeSource attributeSource : attributeSourceContainer.attributeSources() ) {
|
||||||
bindAttribute( attributeBindingContainer, attributeSource );
|
bindAttribute( attributeBindingContainer, attributeSource );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractPluralAttributeBinding bindBagAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private AbstractPluralAttributeBinding bindBagAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final PluralAttributeSource attributeSource,
|
final PluralAttributeSource attributeSource,
|
||||||
PluralAttribute attribute ) {
|
PluralAttribute attribute ) {
|
||||||
if ( attribute == null ) {
|
if ( attribute == null ) {
|
||||||
attribute = attributeBindingContainer.getAttributeContainer().createBag( attributeSource.getName() );
|
attribute = attributeBindingContainer.getAttributeContainer().createBag( attributeSource.getName() );
|
||||||
}
|
}
|
||||||
return attributeBindingContainer.makeBagAttributeBinding( attribute,
|
return attributeBindingContainer.makeBagAttributeBinding(
|
||||||
|
attribute,
|
||||||
pluralAttributeElementNature( attributeSource ),
|
pluralAttributeElementNature( attributeSource ),
|
||||||
pluralAttributeKeyBinding( attributeBindingContainer,
|
pluralAttributeKeyBinding( attributeBindingContainer, attributeSource ),
|
||||||
attributeSource ),
|
|
||||||
propertyAccessorName( attributeSource ),
|
propertyAccessorName( attributeSource ),
|
||||||
attributeSource.isIncludedInOptimisticLocking(),
|
attributeSource.isIncludedInOptimisticLocking(),
|
||||||
false,
|
false,
|
||||||
createMetaAttributeContext( attributeBindingContainer,
|
createMetaAttributeContext( attributeBindingContainer, attributeSource ) );
|
||||||
attributeSource ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BasicAttributeBinding bindBasicAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private BasicAttributeBinding bindBasicAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final SingularAttributeSource attributeSource,
|
final SingularAttributeSource attributeSource,
|
||||||
SingularAttribute attribute ) {
|
SingularAttribute attribute ) {
|
||||||
|
|
||||||
|
@ -215,40 +219,42 @@ public class Binder {
|
||||||
attribute = createSingularAttribute( attributeBindingContainer, attributeSource );
|
attribute = createSingularAttribute( attributeBindingContainer, attributeSource );
|
||||||
}
|
}
|
||||||
final List< RelationalValueBinding > relationalValueBindings =
|
final List< RelationalValueBinding > relationalValueBindings =
|
||||||
bindValues( attributeBindingContainer,
|
bindValues(
|
||||||
|
attributeBindingContainer,
|
||||||
attributeSource,
|
attributeSource,
|
||||||
attribute,
|
attribute,
|
||||||
attributeBindingContainer.seekEntityBinding().getPrimaryTable() );
|
attributeBindingContainer.seekEntityBinding().getPrimaryTable() );
|
||||||
final BasicAttributeBinding attributeBinding =
|
final BasicAttributeBinding attributeBinding =
|
||||||
attributeBindingContainer.makeBasicAttributeBinding( attribute,
|
attributeBindingContainer.makeBasicAttributeBinding(
|
||||||
|
attribute,
|
||||||
relationalValueBindings,
|
relationalValueBindings,
|
||||||
propertyAccessorName( attributeSource ),
|
propertyAccessorName( attributeSource ),
|
||||||
attributeSource.isIncludedInOptimisticLocking(),
|
attributeSource.isIncludedInOptimisticLocking(),
|
||||||
attributeSource.isLazy(),
|
attributeSource.isLazy(),
|
||||||
createMetaAttributeContext( attributeBindingContainer,
|
createMetaAttributeContext( attributeBindingContainer, attributeSource ),
|
||||||
attributeSource ),
|
|
||||||
attributeSource.getGeneration() );
|
attributeSource.getGeneration() );
|
||||||
bindHibernateTypeDescriptor( attributeBinding.getHibernateTypeDescriptor(),
|
bindHibernateTypeDescriptor(
|
||||||
|
attributeBinding.getHibernateTypeDescriptor(),
|
||||||
attributeSource.getTypeInformation(),
|
attributeSource.getTypeInformation(),
|
||||||
attributeBinding.getAttribute(),
|
attributeBinding.getAttribute(),
|
||||||
( AbstractValue ) relationalValueBindings.get( 0 ).getValue() );
|
( AbstractValue ) relationalValueBindings.get( 0 ).getValue() );
|
||||||
final HibernateTypeDescriptor hibernateTypeDescriptor = attributeBinding.getHibernateTypeDescriptor();
|
final HibernateTypeDescriptor hibernateTypeDescriptor = attributeBinding.getHibernateTypeDescriptor();
|
||||||
attributeBinding.getAttribute().resolveType( bindingContexts.peek().
|
attributeBinding.getAttribute().resolveType(
|
||||||
makeJavaType( hibernateTypeDescriptor.getJavaTypeName() ) );
|
bindingContexts.peek().makeJavaType( hibernateTypeDescriptor.getJavaTypeName() ) );
|
||||||
return attributeBinding;
|
return attributeBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindBasicElementSetTablePrimaryKey( final SetBinding attributeBinding ) {
|
private void bindBasicElementSetTablePrimaryKey(
|
||||||
|
final SetBinding attributeBinding ) {
|
||||||
|
|
||||||
final PrimaryKey primaryKey = attributeBinding.getCollectionTable().getPrimaryKey();
|
final PrimaryKey primaryKey = attributeBinding.getCollectionTable().getPrimaryKey();
|
||||||
final ForeignKey foreignKey = attributeBinding.getPluralAttributeKeyBinding().getForeignKey();
|
final ForeignKey foreignKey = attributeBinding.getPluralAttributeKeyBinding().getForeignKey();
|
||||||
final BasicPluralAttributeElementBinding elementBinding =
|
final BasicPluralAttributeElementBinding elementBinding =
|
||||||
( BasicPluralAttributeElementBinding ) attributeBinding.getPluralAttributeElementBinding();
|
( BasicPluralAttributeElementBinding ) attributeBinding.getPluralAttributeElementBinding();
|
||||||
if ( elementBinding.getPluralAttributeElementNature() != PluralAttributeElementNature.BASIC ) {
|
if ( elementBinding.getPluralAttributeElementNature() != PluralAttributeElementNature.BASIC ) {
|
||||||
throw new MappingException(
|
throw new MappingException( String.format(
|
||||||
String.format( "Expected a SetBinding with an element of nature PluralAttributeElementNature.BASIC; instead was %s",
|
"Expected a SetBinding with an element of nature PluralAttributeElementNature.BASIC; instead was %s",
|
||||||
elementBinding.getPluralAttributeElementNature() ),
|
elementBinding.getPluralAttributeElementNature() ), bindingContexts.peek().getOrigin() );
|
||||||
bindingContexts.peek().getOrigin() );
|
|
||||||
}
|
}
|
||||||
for ( final Column foreignKeyColumn : foreignKey.getSourceColumns() ) {
|
for ( final Column foreignKeyColumn : foreignKey.getSourceColumns() ) {
|
||||||
primaryKey.addColumn( foreignKeyColumn );
|
primaryKey.addColumn( foreignKeyColumn );
|
||||||
|
@ -265,15 +271,18 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindBasicPluralElementRelationalValues( final RelationalValueSourceContainer relationalValueSourceContainer,
|
private void bindBasicPluralElementRelationalValues(
|
||||||
|
final RelationalValueSourceContainer relationalValueSourceContainer,
|
||||||
final BasicPluralAttributeElementBinding elementBinding ) {
|
final BasicPluralAttributeElementBinding elementBinding ) {
|
||||||
elementBinding.setRelationalValueBindings( bindValues( elementBinding.getPluralAttributeBinding().getContainer(),
|
elementBinding.setRelationalValueBindings( bindValues(
|
||||||
|
elementBinding.getPluralAttributeBinding().getContainer(),
|
||||||
relationalValueSourceContainer,
|
relationalValueSourceContainer,
|
||||||
elementBinding.getPluralAttributeBinding().getAttribute(),
|
elementBinding.getPluralAttributeBinding().getAttribute(),
|
||||||
elementBinding.getPluralAttributeBinding().getCollectionTable() ) );
|
elementBinding.getPluralAttributeBinding().getCollectionTable() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionElement( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindCollectionElement(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
final PluralAttributeElementSource elementSource = attributeSource.getElementSource();
|
final PluralAttributeElementSource elementSource = attributeSource.getElementSource();
|
||||||
if ( elementSource.getNature() == org.hibernate.metamodel.spi.source.PluralAttributeElementNature.BASIC ) {
|
if ( elementSource.getNature() == org.hibernate.metamodel.spi.source.PluralAttributeElementNature.BASIC ) {
|
||||||
|
@ -287,26 +296,30 @@ public class Binder {
|
||||||
// final Cascadeable cascadeable = (Cascadeable) binding.getPluralAttributeElementBinding();
|
// final Cascadeable cascadeable = (Cascadeable) binding.getPluralAttributeElementBinding();
|
||||||
// cascadeable.setCascadeStyles( source.getCascadeStyles() );
|
// cascadeable.setCascadeStyles( source.getCascadeStyles() );
|
||||||
// todo : implement
|
// todo : implement
|
||||||
throw new NotYetImplementedException( String.format( "Support for collection elements of type %s not yet implemented",
|
throw new NotYetImplementedException( String.format(
|
||||||
|
"Support for collection elements of type %s not yet implemented",
|
||||||
elementSource.getNature() ) );
|
elementSource.getNature() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionIndex( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindCollectionIndex(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
if ( attributeSource.getPluralAttributeNature() != PluralAttributeNature.LIST
|
if ( attributeSource.getPluralAttributeNature() != PluralAttributeNature.LIST &&
|
||||||
&& attributeSource.getPluralAttributeNature() != PluralAttributeNature.MAP ) {
|
attributeSource.getPluralAttributeNature() != PluralAttributeNature.MAP ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// todo : implement
|
// todo : implement
|
||||||
throw new NotYetImplementedException();
|
throw new NotYetImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionKey( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindCollectionKey(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
final PluralAttributeKeySource keySource = attributeSource.getKeySource();
|
final PluralAttributeKeySource keySource = attributeSource.getKeySource();
|
||||||
|
// todo: is null FK name allowed (is there a default?)
|
||||||
final String foreignKeyName =
|
final String foreignKeyName =
|
||||||
StringHelper.isEmpty( keySource.getExplicitForeignKeyName() )
|
StringHelper.isEmpty( keySource.getExplicitForeignKeyName() )
|
||||||
? null // todo: is null FK name allowed (is there a default?)
|
? null
|
||||||
: quotedIdentifier( keySource.getExplicitForeignKeyName() );
|
: quotedIdentifier( keySource.getExplicitForeignKeyName() );
|
||||||
final TableSpecification table = attributeBinding.getContainer().seekEntityBinding().getPrimaryTable();
|
final TableSpecification table = attributeBinding.getContainer().seekEntityBinding().getPrimaryTable();
|
||||||
attributeBinding.getPluralAttributeKeyBinding().prepareForeignKey( foreignKeyName, table );
|
attributeBinding.getPluralAttributeKeyBinding().prepareForeignKey( foreignKeyName, table );
|
||||||
|
@ -318,11 +331,14 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionKeyTargetingPrimaryKey( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindCollectionKeyTargetingPrimaryKey(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeKeySource keySource ) {
|
final PluralAttributeKeySource keySource ) {
|
||||||
for ( final RelationalValueSource valueSource : keySource.getValueSources() ) {
|
for ( final RelationalValueSource valueSource : keySource.getValueSources() ) {
|
||||||
if ( valueSource instanceof ColumnSource ) {
|
if ( valueSource instanceof ColumnSource ) {
|
||||||
final Column column = createColumn( attributeBinding.getCollectionTable(),
|
final Column column =
|
||||||
|
createColumn(
|
||||||
|
attributeBinding.getCollectionTable(),
|
||||||
( ColumnSource ) valueSource,
|
( ColumnSource ) valueSource,
|
||||||
attributeBinding.getAttribute().getName(),
|
attributeBinding.getAttribute().getName(),
|
||||||
false,
|
false,
|
||||||
|
@ -334,40 +350,41 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionKeyTargetingPropertyRef( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindCollectionKeyTargetingPropertyRef(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeKeySource keySource ) {
|
final PluralAttributeKeySource keySource ) {
|
||||||
final EntityBinding ownerEntityBinding = attributeBinding.getContainer().seekEntityBinding();
|
final EntityBinding ownerEntityBinding = attributeBinding.getContainer().seekEntityBinding();
|
||||||
final AttributeBinding referencedAttributeBinding = ownerEntityBinding.locateAttributeBinding(
|
final AttributeBinding referencedAttributeBinding =
|
||||||
keySource.getReferencedEntityAttributeName()
|
ownerEntityBinding.locateAttributeBinding( keySource.getReferencedEntityAttributeName() );
|
||||||
);
|
|
||||||
final ForeignKey foreignKey = attributeBinding.getPluralAttributeKeyBinding().getForeignKey();
|
final ForeignKey foreignKey = attributeBinding.getPluralAttributeKeyBinding().getForeignKey();
|
||||||
if ( !referencedAttributeBinding.getAttribute().isSingular() ) {
|
if ( !referencedAttributeBinding.getAttribute().isSingular() ) {
|
||||||
throw new MappingException(
|
throw new MappingException( String.format(
|
||||||
String.format( "Collection (%s) property-ref is a plural attribute (%s); must be singular.",
|
"Collection (%s) property-ref is a plural attribute (%s); must be singular.",
|
||||||
attributeBinding.getAttribute().getRole(),
|
attributeBinding.getAttribute().getRole(),
|
||||||
referencedAttributeBinding ),
|
referencedAttributeBinding ), bindingContexts.peek().getOrigin() );
|
||||||
bindingContexts.peek().getOrigin() );
|
|
||||||
}
|
}
|
||||||
final Iterator< RelationalValueBinding > targetValueBindings =
|
final Iterator< RelationalValueBinding > targetValueBindings =
|
||||||
( ( SingularAttributeBinding ) referencedAttributeBinding ).getRelationalValueBindings().iterator();
|
( ( SingularAttributeBinding ) referencedAttributeBinding ).getRelationalValueBindings().iterator();
|
||||||
for ( final RelationalValueSource valueSource : keySource.getValueSources() ) {
|
for ( final RelationalValueSource valueSource : keySource.getValueSources() ) {
|
||||||
if ( !targetValueBindings.hasNext() ) {
|
if ( !targetValueBindings.hasNext() ) {
|
||||||
throw new MappingException(
|
throw new MappingException( String.format(
|
||||||
String.format( "More collection key source columns than target columns for collection: %s",
|
"More collection key source columns than target columns for collection: %s",
|
||||||
attributeBinding.getAttribute().getRole() ),
|
attributeBinding.getAttribute().getRole() ), bindingContexts.peek().getOrigin() );
|
||||||
bindingContexts.peek().getOrigin() );
|
|
||||||
}
|
}
|
||||||
final Value targetValue = targetValueBindings.next().getValue();
|
final Value targetValue = targetValueBindings.next().getValue();
|
||||||
if ( ColumnSource.class.isInstance( valueSource ) ) {
|
if ( ColumnSource.class.isInstance( valueSource ) ) {
|
||||||
final ColumnSource columnSource = ( ColumnSource ) valueSource;
|
final ColumnSource columnSource = ( ColumnSource ) valueSource;
|
||||||
final Column column = createColumn( attributeBinding.getCollectionTable(),
|
final Column column =
|
||||||
|
createColumn(
|
||||||
|
attributeBinding.getCollectionTable(),
|
||||||
columnSource,
|
columnSource,
|
||||||
attributeBinding.getAttribute().getName(),
|
attributeBinding.getAttribute().getName(),
|
||||||
false,
|
false,
|
||||||
true );
|
true );
|
||||||
if ( targetValue != null && !( targetValue instanceof Column ) ) {
|
if ( targetValue != null && !( targetValue instanceof Column ) ) {
|
||||||
throw new MappingException(
|
throw new MappingException(
|
||||||
String.format( "Type mismatch between collection key source and target; collection: %s; source column (%s) corresponds with target derived value (%s).",
|
String.format(
|
||||||
|
"Type mismatch between collection key source and target; collection: %s; source column (%s) corresponds with target derived value (%s).",
|
||||||
attributeBinding.getAttribute().getRole(),
|
attributeBinding.getAttribute().getRole(),
|
||||||
columnSource.getName(),
|
columnSource.getName(),
|
||||||
( ( DerivedValue ) targetValue ).getExpression() ),
|
( ( DerivedValue ) targetValue ).getExpression() ),
|
||||||
|
@ -379,13 +396,14 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( targetValueBindings != null && targetValueBindings.hasNext() ) {
|
if ( targetValueBindings != null && targetValueBindings.hasNext() ) {
|
||||||
throw new MappingException( String.format( "More collection key target columns than source columns for collection: %s",
|
throw new MappingException( String.format(
|
||||||
attributeBinding.getAttribute().getRole() ),
|
"More collection key target columns than source columns for collection: %s",
|
||||||
bindingContexts.peek().getOrigin() );
|
attributeBinding.getAttribute().getRole() ), bindingContexts.peek().getOrigin() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionTable( final AbstractPluralAttributeBinding pluralAttributeBinding,
|
private void bindCollectionTable(
|
||||||
|
final AbstractPluralAttributeBinding pluralAttributeBinding,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
if ( attributeSource.getElementSource().getNature() == org.hibernate.metamodel.spi.source.PluralAttributeElementNature.ONE_TO_MANY ) {
|
if ( attributeSource.getElementSource().getNature() == org.hibernate.metamodel.spi.source.PluralAttributeElementNature.ONE_TO_MANY ) {
|
||||||
return;
|
return;
|
||||||
|
@ -396,18 +414,20 @@ public class Binder {
|
||||||
public String defaultName() {
|
public String defaultName() {
|
||||||
final AttributeBindingContainer attributeBindingContainer = pluralAttributeBinding.getContainer();
|
final AttributeBindingContainer attributeBindingContainer = pluralAttributeBinding.getContainer();
|
||||||
final EntityBinding owner = attributeBindingContainer.seekEntityBinding();
|
final EntityBinding owner = attributeBindingContainer.seekEntityBinding();
|
||||||
final String ownerTableLogicalName = Table.class.isInstance( owner.getPrimaryTable() )
|
final String ownerTableLogicalName =
|
||||||
|
Table.class.isInstance( owner.getPrimaryTable() )
|
||||||
? ( ( Table ) owner.getPrimaryTable() ).getTableName().getName()
|
? ( ( Table ) owner.getPrimaryTable() ).getTableName().getName()
|
||||||
: null;
|
: null;
|
||||||
return bindingContexts.peek().getNamingStrategy().collectionTableName( owner.getEntity().getName(),
|
return bindingContexts.peek().getNamingStrategy().collectionTableName(
|
||||||
|
owner.getEntity().getName(),
|
||||||
ownerTableLogicalName,
|
ownerTableLogicalName,
|
||||||
null, // todo: here
|
null, // todo: here
|
||||||
null, // todo: and here
|
null, // todo: and here
|
||||||
attributeBindingContainer.getPathBase()
|
attributeBindingContainer.getPathBase() + '.' + attributeSource.getName() );
|
||||||
+ '.' + attributeSource.getName() );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
pluralAttributeBinding.setCollectionTable( createTable( attributeSource.getCollectionTableSpecificationSource(),
|
pluralAttributeBinding.setCollectionTable( createTable(
|
||||||
|
attributeSource.getCollectionTableSpecificationSource(),
|
||||||
defaultNamingStategy ) );
|
defaultNamingStategy ) );
|
||||||
if ( StringHelper.isNotEmpty( attributeSource.getCollectionTableComment() ) ) {
|
if ( StringHelper.isNotEmpty( attributeSource.getCollectionTableComment() ) ) {
|
||||||
pluralAttributeBinding.getCollectionTable().addComment( attributeSource.getCollectionTableComment() );
|
pluralAttributeBinding.getCollectionTable().addComment( attributeSource.getCollectionTableComment() );
|
||||||
|
@ -417,10 +437,11 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindCollectionTablePrimaryKey( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindCollectionTablePrimaryKey(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
if ( attributeSource.getElementSource().getNature() == org.hibernate.metamodel.spi.source.PluralAttributeElementNature.ONE_TO_MANY
|
if ( attributeSource.getElementSource().getNature() == org.hibernate.metamodel.spi.source.PluralAttributeElementNature.ONE_TO_MANY ||
|
||||||
|| attributeSource.getPluralAttributeNature() == PluralAttributeNature.BAG ) {
|
attributeSource.getPluralAttributeNature() == PluralAttributeNature.BAG ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( attributeBinding.getPluralAttributeElementBinding().getPluralAttributeElementNature() == PluralAttributeElementNature.BASIC ) {
|
if ( attributeBinding.getPluralAttributeElementBinding().getPluralAttributeElementNature() == PluralAttributeElementNature.BASIC ) {
|
||||||
|
@ -432,15 +453,16 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompositeAttributeBinding bindComponentAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private CompositeAttributeBinding bindComponentAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final ComponentAttributeSource attributeSource,
|
final ComponentAttributeSource attributeSource,
|
||||||
SingularAttribute attribute ) {
|
SingularAttribute attribute ) {
|
||||||
Composite composite;
|
Composite composite;
|
||||||
if ( attribute == null ) {
|
if ( attribute == null ) {
|
||||||
composite = new Composite( attributeSource.getPath(), attributeSource.getClassName(),
|
composite =
|
||||||
attributeSource.getClassReference(), null );
|
new Composite( attributeSource.getPath(), attributeSource.getClassName(), attributeSource.getClassReference(), null );
|
||||||
attribute = attributeBindingContainer.getAttributeContainer().createCompositeAttribute( attributeSource.getName(),
|
attribute =
|
||||||
composite );
|
attributeBindingContainer.getAttributeContainer().createCompositeAttribute( attributeSource.getName(), composite );
|
||||||
} else {
|
} else {
|
||||||
composite = ( Composite ) attribute.getSingularAttributeType();
|
composite = ( Composite ) attribute.getSingularAttributeType();
|
||||||
}
|
}
|
||||||
|
@ -451,18 +473,19 @@ public class Binder {
|
||||||
referencingAttribute = composite.createSingularAttribute( attributeSource.getParentReferenceAttributeName() );
|
referencingAttribute = composite.createSingularAttribute( attributeSource.getParentReferenceAttributeName() );
|
||||||
}
|
}
|
||||||
final CompositeAttributeBinding attributeBinding =
|
final CompositeAttributeBinding attributeBinding =
|
||||||
attributeBindingContainer.makeComponentAttributeBinding( attribute,
|
attributeBindingContainer.makeComponentAttributeBinding(
|
||||||
|
attribute,
|
||||||
referencingAttribute,
|
referencingAttribute,
|
||||||
propertyAccessorName( attributeSource ),
|
propertyAccessorName( attributeSource ),
|
||||||
attributeSource.isIncludedInOptimisticLocking(),
|
attributeSource.isIncludedInOptimisticLocking(),
|
||||||
attributeSource.isLazy(),
|
attributeSource.isLazy(),
|
||||||
createMetaAttributeContext( attributeBindingContainer,
|
createMetaAttributeContext( attributeBindingContainer, attributeSource ) );
|
||||||
attributeSource ) );
|
|
||||||
bindAttributes( attributeBinding, attributeSource );
|
bindAttributes( attributeBinding, attributeSource );
|
||||||
return attributeBinding;
|
return attributeBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindDiscriminator( final EntityBinding rootEntityBinding,
|
private void bindDiscriminator(
|
||||||
|
final EntityBinding rootEntityBinding,
|
||||||
final RootEntitySource rootEntitySource ) {
|
final RootEntitySource rootEntitySource ) {
|
||||||
final DiscriminatorSource discriminatorSource = rootEntitySource.getDiscriminatorSource();
|
final DiscriminatorSource discriminatorSource = rootEntitySource.getDiscriminatorSource();
|
||||||
if ( discriminatorSource == null ) {
|
if ( discriminatorSource == null ) {
|
||||||
|
@ -472,7 +495,9 @@ public class Binder {
|
||||||
final TableSpecification table = rootEntityBinding.locateTable( valueSource.getContainingTableName() );
|
final TableSpecification table = rootEntityBinding.locateTable( valueSource.getContainingTableName() );
|
||||||
AbstractValue value;
|
AbstractValue value;
|
||||||
if ( valueSource instanceof ColumnSource ) {
|
if ( valueSource instanceof ColumnSource ) {
|
||||||
value = createColumn( table,
|
value =
|
||||||
|
createColumn(
|
||||||
|
table,
|
||||||
( ColumnSource ) valueSource,
|
( ColumnSource ) valueSource,
|
||||||
bindingContexts.peek().getMappingDefaults().getDiscriminatorColumnName(),
|
bindingContexts.peek().getMappingDefaults().getDiscriminatorColumnName(),
|
||||||
false,
|
false,
|
||||||
|
@ -480,12 +505,13 @@ public class Binder {
|
||||||
} else {
|
} else {
|
||||||
value = table.locateOrCreateDerivedValue( ( ( DerivedValueSource ) valueSource ).getExpression() );
|
value = table.locateOrCreateDerivedValue( ( ( DerivedValueSource ) valueSource ).getExpression() );
|
||||||
}
|
}
|
||||||
final EntityDiscriminator discriminator = new EntityDiscriminator( value, discriminatorSource.isInserted(),
|
final EntityDiscriminator discriminator =
|
||||||
discriminatorSource.isForced() );
|
new EntityDiscriminator( value, discriminatorSource.isInserted(), discriminatorSource.isForced() );
|
||||||
rootEntityBinding.getHierarchyDetails().setEntityDiscriminator( discriminator );
|
rootEntityBinding.getHierarchyDetails().setEntityDiscriminator( discriminator );
|
||||||
rootEntityBinding.setDiscriminatorMatchValue( rootEntitySource.getDiscriminatorMatchValue() );
|
rootEntityBinding.setDiscriminatorMatchValue( rootEntitySource.getDiscriminatorMatchValue() );
|
||||||
// Configure discriminator hibernate type
|
// Configure discriminator hibernate type
|
||||||
final String typeName = discriminatorSource.getExplicitHibernateTypeName() != null
|
final String typeName =
|
||||||
|
discriminatorSource.getExplicitHibernateTypeName() != null
|
||||||
? discriminatorSource.getExplicitHibernateTypeName()
|
? discriminatorSource.getExplicitHibernateTypeName()
|
||||||
: "string";
|
: "string";
|
||||||
final HibernateTypeDescriptor hibernateTypeDescriptor = discriminator.getExplicitHibernateTypeDescriptor();
|
final HibernateTypeDescriptor hibernateTypeDescriptor = discriminator.getExplicitHibernateTypeDescriptor();
|
||||||
|
@ -493,7 +519,8 @@ public class Binder {
|
||||||
resolveHibernateResolvedType( hibernateTypeDescriptor, typeName, value );
|
resolveHibernateResolvedType( hibernateTypeDescriptor, typeName, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityBinding bindEntities( final EntityHierarchy entityHierarchy ) {
|
private EntityBinding bindEntities(
|
||||||
|
final EntityHierarchy entityHierarchy ) {
|
||||||
final RootEntitySource rootEntitySource = entityHierarchy.getRootEntitySource();
|
final RootEntitySource rootEntitySource = entityHierarchy.getRootEntitySource();
|
||||||
// Return existing binding if available
|
// Return existing binding if available
|
||||||
EntityBinding rootEntityBinding = metadata.getEntityBinding( rootEntitySource.getEntityName() );
|
EntityBinding rootEntityBinding = metadata.getEntityBinding( rootEntitySource.getEntityName() );
|
||||||
|
@ -528,7 +555,8 @@ public class Binder {
|
||||||
return rootEntityBinding;
|
return rootEntityBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bindEntities( final Iterable< EntityHierarchy > entityHierarchies ) {
|
public void bindEntities(
|
||||||
|
final Iterable< EntityHierarchy > entityHierarchies ) {
|
||||||
entitySourcesByName.clear();
|
entitySourcesByName.clear();
|
||||||
attributeSourcesByName.clear();
|
attributeSourcesByName.clear();
|
||||||
inheritanceTypes.clear();
|
inheritanceTypes.clear();
|
||||||
|
@ -546,7 +574,8 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityBinding bindEntity( final EntitySource entitySource,
|
private EntityBinding bindEntity(
|
||||||
|
final EntitySource entitySource,
|
||||||
final EntityBinding superEntityBinding ) {
|
final EntityBinding superEntityBinding ) {
|
||||||
// Return existing binding if available
|
// Return existing binding if available
|
||||||
EntityBinding entityBinding = metadata.getEntityBinding( entitySource.getEntityName() );
|
EntityBinding entityBinding = metadata.getEntityBinding( entitySource.getEntityName() );
|
||||||
|
@ -560,7 +589,8 @@ public class Binder {
|
||||||
return entityBinding;
|
return entityBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindHibernateTypeDescriptor( final HibernateTypeDescriptor hibernateTypeDescriptor,
|
private void bindHibernateTypeDescriptor(
|
||||||
|
final HibernateTypeDescriptor hibernateTypeDescriptor,
|
||||||
final ExplicitHibernateTypeSource typeSource,
|
final ExplicitHibernateTypeSource typeSource,
|
||||||
final Attribute attribute,
|
final Attribute attribute,
|
||||||
final AbstractValue value ) {
|
final AbstractValue value ) {
|
||||||
|
@ -589,7 +619,8 @@ public class Binder {
|
||||||
resolveHibernateResolvedType( hibernateTypeDescriptor, typeName, value );
|
resolveHibernateResolvedType( hibernateTypeDescriptor, typeName, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindIdentifier( final EntityBinding rootEntityBinding,
|
private void bindIdentifier(
|
||||||
|
final EntityBinding rootEntityBinding,
|
||||||
final IdentifierSource identifierSource ) {
|
final IdentifierSource identifierSource ) {
|
||||||
final Nature nature = identifierSource.getNature();
|
final Nature nature = identifierSource.getNature();
|
||||||
if ( nature == Nature.SIMPLE ) {
|
if ( nature == Nature.SIMPLE ) {
|
||||||
|
@ -609,28 +640,31 @@ public class Binder {
|
||||||
return bindingContexts.peek();
|
return bindingContexts.peek();
|
||||||
}
|
}
|
||||||
|
|
||||||
private ManyToOneAttributeBinding bindManyToOneAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private ManyToOneAttributeBinding bindManyToOneAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final ToOneAttributeSource attributeSource,
|
final ToOneAttributeSource attributeSource,
|
||||||
SingularAttribute attribute ) {
|
SingularAttribute attribute ) {
|
||||||
if ( attribute == null ) {
|
if ( attribute == null ) {
|
||||||
attribute = createSingularAttribute( attributeBindingContainer, attributeSource );
|
attribute = createSingularAttribute( attributeBindingContainer, attributeSource );
|
||||||
}
|
}
|
||||||
final List< RelationalValueBinding > relationalValueBindings =
|
final List< RelationalValueBinding > relationalValueBindings =
|
||||||
bindValues( attributeBindingContainer,
|
bindValues(
|
||||||
|
attributeBindingContainer,
|
||||||
attributeSource,
|
attributeSource,
|
||||||
attribute,
|
attribute,
|
||||||
attributeBindingContainer.seekEntityBinding().getPrimaryTable() );
|
attributeBindingContainer.seekEntityBinding().getPrimaryTable() );
|
||||||
final ManyToOneAttributeBinding attributeBinding =
|
final ManyToOneAttributeBinding attributeBinding =
|
||||||
attributeBindingContainer.makeManyToOneAttributeBinding( attribute,
|
attributeBindingContainer.makeManyToOneAttributeBinding(
|
||||||
|
attribute,
|
||||||
propertyAccessorName( attributeSource ),
|
propertyAccessorName( attributeSource ),
|
||||||
attributeSource.isIncludedInOptimisticLocking(),
|
attributeSource.isIncludedInOptimisticLocking(),
|
||||||
attributeSource.isLazy(),
|
attributeSource.isLazy(),
|
||||||
createMetaAttributeContext( attributeBindingContainer,
|
createMetaAttributeContext( attributeBindingContainer, attributeSource ),
|
||||||
attributeSource ),
|
|
||||||
null, // this isn't passed to the binding constructor
|
null, // this isn't passed to the binding constructor
|
||||||
null, // this isn't passed to the binding constructor
|
null, // this isn't passed to the binding constructor
|
||||||
relationalValueBindings );
|
relationalValueBindings );
|
||||||
bindHibernateTypeDescriptor( attributeBinding.getHibernateTypeDescriptor(),
|
bindHibernateTypeDescriptor(
|
||||||
|
attributeBinding.getHibernateTypeDescriptor(),
|
||||||
attributeSource.getTypeInformation(),
|
attributeSource.getTypeInformation(),
|
||||||
attributeBinding.getAttribute(),
|
attributeBinding.getAttribute(),
|
||||||
( AbstractValue ) relationalValueBindings.get( 0 ).getValue() );
|
( AbstractValue ) relationalValueBindings.get( 0 ).getValue() );
|
||||||
|
@ -649,7 +683,8 @@ public class Binder {
|
||||||
final EntityBinding referencedEntityBinding = entityBinding( referencedEntityName );
|
final EntityBinding referencedEntityBinding = entityBinding( referencedEntityName );
|
||||||
final String referencedAttributeName = attributeSource.getReferencedEntityAttributeName();
|
final String referencedAttributeName = attributeSource.getReferencedEntityAttributeName();
|
||||||
attributeBinding.setReferencedAttributeName( referencedAttributeName );
|
attributeBinding.setReferencedAttributeName( referencedAttributeName );
|
||||||
final AttributeBinding referencedAttributeBinding = referencedAttributeName == null
|
final AttributeBinding referencedAttributeBinding =
|
||||||
|
referencedAttributeName == null
|
||||||
? referencedEntityBinding.getHierarchyDetails().getEntityIdentifier().getValueBinding()
|
? referencedEntityBinding.getHierarchyDetails().getEntityIdentifier().getValueBinding()
|
||||||
: referencedEntityBinding.locateAttributeBinding( referencedAttributeName );
|
: referencedEntityBinding.locateAttributeBinding( referencedAttributeName );
|
||||||
attributeBinding.resolveReference( referencedAttributeBinding );
|
attributeBinding.resolveReference( referencedAttributeBinding );
|
||||||
|
@ -657,7 +692,8 @@ public class Binder {
|
||||||
return attributeBinding;
|
return attributeBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractPluralAttributeBinding bindPluralAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private AbstractPluralAttributeBinding bindPluralAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
final PluralAttributeNature nature = attributeSource.getPluralAttributeNature();
|
final PluralAttributeNature nature = attributeSource.getPluralAttributeNature();
|
||||||
final PluralAttribute attribute =
|
final PluralAttribute attribute =
|
||||||
|
@ -675,12 +711,11 @@ public class Binder {
|
||||||
attributeBinding.setCaching( attributeSource.getCaching() );
|
attributeBinding.setCaching( attributeSource.getCaching() );
|
||||||
attributeBinding.getHibernateTypeDescriptor().setJavaTypeName( nature.reportedJavaType().getName() );
|
attributeBinding.getHibernateTypeDescriptor().setJavaTypeName( nature.reportedJavaType().getName() );
|
||||||
attributeBinding.getHibernateTypeDescriptor().setExplicitTypeName( attributeSource.getTypeInformation().getName() );
|
attributeBinding.getHibernateTypeDescriptor().setExplicitTypeName( attributeSource.getTypeInformation().getName() );
|
||||||
attributeBinding.getHibernateTypeDescriptor().getTypeParameters().putAll( attributeSource.getTypeInformation().
|
attributeBinding.getHibernateTypeDescriptor().getTypeParameters().putAll(
|
||||||
getParameters() );
|
attributeSource.getTypeInformation().getParameters() );
|
||||||
if ( StringHelper.isNotEmpty( attributeSource.getCustomPersisterClassName() ) ) {
|
if ( StringHelper.isNotEmpty( attributeSource.getCustomPersisterClassName() ) ) {
|
||||||
attributeBinding.setExplicitPersisterClass( bindingContexts.peek().
|
attributeBinding.setExplicitPersisterClass( bindingContexts.peek().< CollectionPersister >locateClassByName(
|
||||||
< CollectionPersister >locateClassByName( attributeSource.
|
attributeSource.getCustomPersisterClassName() ) );
|
||||||
getCustomPersisterClassName() ) );
|
|
||||||
}
|
}
|
||||||
attributeBinding.setCustomLoaderName( attributeSource.getCustomLoaderName() );
|
attributeBinding.setCustomLoaderName( attributeSource.getCustomLoaderName() );
|
||||||
attributeBinding.setCustomSqlInsert( attributeSource.getCustomSqlInsert() );
|
attributeBinding.setCustomSqlInsert( attributeSource.getCustomSqlInsert() );
|
||||||
|
@ -699,7 +734,8 @@ public class Binder {
|
||||||
return attributeBinding;
|
return attributeBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindPrimaryTable( final EntityBinding entityBinding,
|
private void bindPrimaryTable(
|
||||||
|
final EntityBinding entityBinding,
|
||||||
final EntitySource entitySource ) {
|
final EntitySource entitySource ) {
|
||||||
entityBinding.setPrimaryTable( createTable( entitySource.getPrimaryTable(), new DefaultNamingStrategy() {
|
entityBinding.setPrimaryTable( createTable( entitySource.getPrimaryTable(), new DefaultNamingStrategy() {
|
||||||
|
|
||||||
|
@ -710,7 +746,8 @@ public class Binder {
|
||||||
} ) );
|
} ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindSecondaryTables( final EntityBinding entityBinding,
|
private void bindSecondaryTables(
|
||||||
|
final EntityBinding entityBinding,
|
||||||
final EntitySource entitySource ) {
|
final EntitySource entitySource ) {
|
||||||
final TableSpecification primaryTable = entityBinding.getPrimaryTable();
|
final TableSpecification primaryTable = entityBinding.getPrimaryTable();
|
||||||
for ( final SecondaryTableSource secondaryTableSource : entitySource.getSecondaryTables() ) {
|
for ( final SecondaryTableSource secondaryTableSource : entitySource.getSecondaryTables() ) {
|
||||||
|
@ -748,25 +785,26 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractPluralAttributeBinding bindSetAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private AbstractPluralAttributeBinding bindSetAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final PluralAttributeSource attributeSource,
|
final PluralAttributeSource attributeSource,
|
||||||
PluralAttribute attribute ) {
|
PluralAttribute attribute ) {
|
||||||
if ( attribute == null ) {
|
if ( attribute == null ) {
|
||||||
attribute = attributeBindingContainer.getAttributeContainer().createSet( attributeSource.getName() );
|
attribute = attributeBindingContainer.getAttributeContainer().createSet( attributeSource.getName() );
|
||||||
}
|
}
|
||||||
return attributeBindingContainer.makeSetAttributeBinding( attribute,
|
return attributeBindingContainer.makeSetAttributeBinding(
|
||||||
|
attribute,
|
||||||
pluralAttributeElementNature( attributeSource ),
|
pluralAttributeElementNature( attributeSource ),
|
||||||
pluralAttributeKeyBinding( attributeBindingContainer,
|
pluralAttributeKeyBinding( attributeBindingContainer, attributeSource ),
|
||||||
attributeSource ),
|
|
||||||
propertyAccessorName( attributeSource ),
|
propertyAccessorName( attributeSource ),
|
||||||
attributeSource.isIncludedInOptimisticLocking(),
|
attributeSource.isIncludedInOptimisticLocking(),
|
||||||
false,
|
false,
|
||||||
createMetaAttributeContext( attributeBindingContainer,
|
createMetaAttributeContext( attributeBindingContainer, attributeSource ),
|
||||||
attributeSource ),
|
|
||||||
null );
|
null );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindSimpleIdentifier( final EntityBinding rootEntityBinding,
|
private void bindSimpleIdentifier(
|
||||||
|
final EntityBinding rootEntityBinding,
|
||||||
final SimpleIdentifierSource identifierSource ) {
|
final SimpleIdentifierSource identifierSource ) {
|
||||||
final BasicAttributeBinding idAttributeBinding =
|
final BasicAttributeBinding idAttributeBinding =
|
||||||
( BasicAttributeBinding ) bindAttribute( rootEntityBinding, identifierSource.getIdentifierAttributeSource() );
|
( BasicAttributeBinding ) bindAttribute( rootEntityBinding, identifierSource.getIdentifierAttributeSource() );
|
||||||
|
@ -785,7 +823,8 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SingularAttributeBinding bindSingularAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private SingularAttributeBinding bindSingularAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final SingularAttributeSource attributeSource ) {
|
final SingularAttributeSource attributeSource ) {
|
||||||
final SingularAttributeNature nature = attributeSource.getNature();
|
final SingularAttributeNature nature = attributeSource.getNature();
|
||||||
final SingularAttribute attribute =
|
final SingularAttribute attribute =
|
||||||
|
@ -797,14 +836,13 @@ public class Binder {
|
||||||
return bindManyToOneAttribute( attributeBindingContainer, ( ToOneAttributeSource ) attributeSource, attribute );
|
return bindManyToOneAttribute( attributeBindingContainer, ( ToOneAttributeSource ) attributeSource, attribute );
|
||||||
}
|
}
|
||||||
if ( nature == SingularAttributeNature.COMPONENT ) {
|
if ( nature == SingularAttributeNature.COMPONENT ) {
|
||||||
return bindComponentAttribute( attributeBindingContainer,
|
return bindComponentAttribute( attributeBindingContainer, ( ComponentAttributeSource ) attributeSource, attribute );
|
||||||
( ComponentAttributeSource ) attributeSource,
|
|
||||||
attribute );
|
|
||||||
}
|
}
|
||||||
throw new NotYetImplementedException( nature.toString() );
|
throw new NotYetImplementedException( nature.toString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindSortingAndOrdering( final AbstractPluralAttributeBinding attributeBinding,
|
private void bindSortingAndOrdering(
|
||||||
|
final AbstractPluralAttributeBinding attributeBinding,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
if ( Sortable.class.isInstance( attributeSource ) ) {
|
if ( Sortable.class.isInstance( attributeSource ) ) {
|
||||||
final Sortable sortable = ( Sortable ) attributeSource;
|
final Sortable sortable = ( Sortable ) attributeSource;
|
||||||
|
@ -822,14 +860,16 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindSubEntities( final EntityBinding entityBinding,
|
private void bindSubEntities(
|
||||||
|
final EntityBinding entityBinding,
|
||||||
final EntitySource entitySource ) {
|
final EntitySource entitySource ) {
|
||||||
for ( final SubclassEntitySource subEntitySource : entitySource.subclassEntitySources() ) {
|
for ( final SubclassEntitySource subEntitySource : entitySource.subclassEntitySources() ) {
|
||||||
bindEntity( subEntitySource, entityBinding );
|
bindEntity( subEntitySource, entityBinding );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindUniqueConstraints( final EntityBinding entityBinding,
|
private void bindUniqueConstraints(
|
||||||
|
final EntityBinding entityBinding,
|
||||||
final EntitySource entitySource ) {
|
final EntitySource entitySource ) {
|
||||||
for ( final ConstraintSource constraintSource : entitySource.getConstraints() ) {
|
for ( final ConstraintSource constraintSource : entitySource.getConstraints() ) {
|
||||||
if ( constraintSource instanceof UniqueConstraintSource ) {
|
if ( constraintSource instanceof UniqueConstraintSource ) {
|
||||||
|
@ -846,7 +886,8 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List< RelationalValueBinding > bindValues( final AttributeBindingContainer attributeBindingContainer,
|
private List< RelationalValueBinding > bindValues(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final RelationalValueSourceContainer valueSourceContainer,
|
final RelationalValueSourceContainer valueSourceContainer,
|
||||||
final Attribute attribute,
|
final Attribute attribute,
|
||||||
final TableSpecification defaultTable ) {
|
final TableSpecification defaultTable ) {
|
||||||
|
@ -866,17 +907,17 @@ public class Binder {
|
||||||
: attributeBindingContainer.seekEntityBinding().locateTable( valueSource.getContainingTableName() );
|
: attributeBindingContainer.seekEntityBinding().locateTable( valueSource.getContainingTableName() );
|
||||||
if ( valueSource instanceof ColumnSource ) {
|
if ( valueSource instanceof ColumnSource ) {
|
||||||
final ColumnSource columnSource = ( ColumnSource ) valueSource;
|
final ColumnSource columnSource = ( ColumnSource ) valueSource;
|
||||||
final boolean isIncludedInInsert = toBoolean( columnSource.isIncludedInInsert(),
|
final boolean isIncludedInInsert =
|
||||||
valueSourceContainer.areValuesIncludedInInsertByDefault() );
|
toBoolean( columnSource.isIncludedInInsert(), valueSourceContainer.areValuesIncludedInInsertByDefault() );
|
||||||
final boolean isIncludedInUpdate = toBoolean( columnSource.isIncludedInUpdate(),
|
final boolean isIncludedInUpdate =
|
||||||
valueSourceContainer.areValuesIncludedInUpdateByDefault() );
|
toBoolean( columnSource.isIncludedInUpdate(), valueSourceContainer.areValuesIncludedInUpdateByDefault() );
|
||||||
|
|
||||||
valueBindings.add( new RelationalValueBinding( createColumn( table,
|
valueBindings.add( new RelationalValueBinding( createColumn(
|
||||||
|
table,
|
||||||
columnSource,
|
columnSource,
|
||||||
name,
|
name,
|
||||||
valueSourceContainer.areValuesNullableByDefault(),
|
valueSourceContainer.areValuesNullableByDefault(),
|
||||||
true ),
|
true ), isIncludedInInsert, isIncludedInUpdate ) );
|
||||||
isIncludedInInsert, isIncludedInUpdate ) );
|
|
||||||
} else {
|
} else {
|
||||||
final DerivedValue derivedValue =
|
final DerivedValue derivedValue =
|
||||||
table.locateOrCreateDerivedValue( ( ( DerivedValueSource ) valueSource ).getExpression() );
|
table.locateOrCreateDerivedValue( ( ( DerivedValueSource ) valueSource ).getExpression() );
|
||||||
|
@ -887,24 +928,26 @@ public class Binder {
|
||||||
return valueBindings;
|
return valueBindings;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindVersion( final EntityBinding rootEntityBinding,
|
private void bindVersion(
|
||||||
|
final EntityBinding rootEntityBinding,
|
||||||
final VersionAttributeSource versionAttributeSource ) {
|
final VersionAttributeSource versionAttributeSource ) {
|
||||||
if ( versionAttributeSource == null ) {
|
if ( versionAttributeSource == null ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final EntityVersion version = rootEntityBinding.getHierarchyDetails().getEntityVersion();
|
final EntityVersion version = rootEntityBinding.getHierarchyDetails().getEntityVersion();
|
||||||
version.setVersioningAttributeBinding( ( BasicAttributeBinding ) bindAttribute( rootEntityBinding,
|
version.setVersioningAttributeBinding( ( BasicAttributeBinding ) bindAttribute( rootEntityBinding, versionAttributeSource ) );
|
||||||
versionAttributeSource ) );
|
|
||||||
version.setUnsavedValue( versionAttributeSource.getUnsavedValue() );
|
version.setUnsavedValue( versionAttributeSource.getUnsavedValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Column createColumn( final TableSpecification table,
|
private Column createColumn(
|
||||||
|
final TableSpecification table,
|
||||||
final ColumnSource columnSource,
|
final ColumnSource columnSource,
|
||||||
final String defaultName,
|
final String defaultName,
|
||||||
final boolean isNullableByDefault,
|
final boolean isNullableByDefault,
|
||||||
final boolean isDefaultAttributeName ) {
|
final boolean isDefaultAttributeName ) {
|
||||||
if ( columnSource.getName() == null && defaultName == null ) {
|
if ( columnSource.getName() == null && defaultName == null ) {
|
||||||
throw new MappingException( "Cannot resolve name for column because no name was specified and default name is null.",
|
throw new MappingException(
|
||||||
|
"Cannot resolve name for column because no name was specified and default name is null.",
|
||||||
bindingContexts.peek().getOrigin() );
|
bindingContexts.peek().getOrigin() );
|
||||||
}
|
}
|
||||||
String name;
|
String name;
|
||||||
|
@ -930,7 +973,8 @@ public class Binder {
|
||||||
return column;
|
return column;
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityBinding createEntityBinding( final EntitySource entitySource,
|
private EntityBinding createEntityBinding(
|
||||||
|
final EntitySource entitySource,
|
||||||
final EntityBinding superEntityBinding ) {
|
final EntityBinding superEntityBinding ) {
|
||||||
final LocalBindingContext bindingContext = entitySource.getLocalBindingContext();
|
final LocalBindingContext bindingContext = entitySource.getLocalBindingContext();
|
||||||
bindingContexts.push( bindingContext );
|
bindingContexts.push( bindingContext );
|
||||||
|
@ -938,12 +982,14 @@ public class Binder {
|
||||||
// Create binding
|
// Create binding
|
||||||
final InheritanceType inheritanceType = inheritanceTypes.peek();
|
final InheritanceType inheritanceType = inheritanceTypes.peek();
|
||||||
final EntityMode entityMode = entityModes.peek();
|
final EntityMode entityMode = entityModes.peek();
|
||||||
final EntityBinding entityBinding = entitySource instanceof RootEntitySource
|
final EntityBinding entityBinding =
|
||||||
? new EntityBinding( inheritanceType, entityMode )
|
entitySource instanceof RootEntitySource ? new EntityBinding( inheritanceType, entityMode ) : new EntityBinding(
|
||||||
: new EntityBinding( superEntityBinding );
|
superEntityBinding );
|
||||||
// Create domain entity
|
// Create domain entity
|
||||||
final String entityClassName = entityMode == EntityMode.POJO ? entitySource.getClassName() : null;
|
final String entityClassName = entityMode == EntityMode.POJO ? entitySource.getClassName() : null;
|
||||||
entityBinding.setEntity( new Entity( entitySource.getEntityName(), entityClassName,
|
entityBinding.setEntity( new Entity(
|
||||||
|
entitySource.getEntityName(),
|
||||||
|
entityClassName,
|
||||||
bindingContext.makeClassReference( entityClassName ),
|
bindingContext.makeClassReference( entityClassName ),
|
||||||
superEntityBinding == null ? null : superEntityBinding.getEntity() ) );
|
superEntityBinding == null ? null : superEntityBinding.getEntity() ) );
|
||||||
// Create relational table
|
// Create relational table
|
||||||
|
@ -963,15 +1009,14 @@ public class Binder {
|
||||||
// Configure rest of binding
|
// Configure rest of binding
|
||||||
final String customTuplizerClassName = entitySource.getCustomTuplizerClassName();
|
final String customTuplizerClassName = entitySource.getCustomTuplizerClassName();
|
||||||
if ( customTuplizerClassName != null ) {
|
if ( customTuplizerClassName != null ) {
|
||||||
entityBinding.setCustomEntityTuplizerClass( bindingContext.
|
entityBinding.setCustomEntityTuplizerClass( bindingContext.< EntityTuplizer >locateClassByName( customTuplizerClassName ) );
|
||||||
< EntityTuplizer >locateClassByName( customTuplizerClassName ) );
|
|
||||||
}
|
}
|
||||||
final String customPersisterClassName = entitySource.getCustomPersisterClassName();
|
final String customPersisterClassName = entitySource.getCustomPersisterClassName();
|
||||||
if ( customPersisterClassName != null ) {
|
if ( customPersisterClassName != null ) {
|
||||||
entityBinding.setCustomEntityPersisterClass( bindingContext.
|
entityBinding.setCustomEntityPersisterClass( bindingContext.< EntityPersister >locateClassByName( customPersisterClassName ) );
|
||||||
< EntityPersister >locateClassByName( customPersisterClassName ) );
|
|
||||||
}
|
}
|
||||||
entityBinding.setMetaAttributeContext( createMetaAttributeContext( entitySource.metaAttributes(),
|
entityBinding.setMetaAttributeContext( createMetaAttributeContext(
|
||||||
|
entitySource.metaAttributes(),
|
||||||
true,
|
true,
|
||||||
metadata.getGlobalMetaAttributeContext() ) );
|
metadata.getGlobalMetaAttributeContext() ) );
|
||||||
entityBinding.setJpaEntityName( entitySource.getJpaEntityName() );
|
entityBinding.setJpaEntityName( entitySource.getJpaEntityName() );
|
||||||
|
@ -1014,7 +1059,8 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Identifier createIdentifier( String name,
|
private Identifier createIdentifier(
|
||||||
|
String name,
|
||||||
final String defaultName ) {
|
final String defaultName ) {
|
||||||
if ( StringHelper.isEmpty( name ) ) {
|
if ( StringHelper.isEmpty( name ) ) {
|
||||||
name = defaultName;
|
name = defaultName;
|
||||||
|
@ -1023,7 +1069,8 @@ public class Binder {
|
||||||
return Identifier.toIdentifier( name );
|
return Identifier.toIdentifier( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createIdentifierGenerator( final EntityBinding rootEntityBinding ) {
|
private void createIdentifierGenerator(
|
||||||
|
final EntityBinding rootEntityBinding ) {
|
||||||
final Properties properties = new Properties();
|
final Properties properties = new Properties();
|
||||||
properties.putAll( metadata.getServiceRegistry().getService( ConfigurationService.class ).getSettings() );
|
properties.putAll( metadata.getServiceRegistry().getService( ConfigurationService.class ).getSettings() );
|
||||||
if ( !properties.contains( AvailableSettings.PREFER_POOLED_VALUES_LO ) ) {
|
if ( !properties.contains( AvailableSettings.PREFER_POOLED_VALUES_LO ) ) {
|
||||||
|
@ -1032,18 +1079,22 @@ public class Binder {
|
||||||
if ( !properties.contains( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER ) ) {
|
if ( !properties.contains( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER ) ) {
|
||||||
properties.put( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, nameNormalizer );
|
properties.put( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, nameNormalizer );
|
||||||
}
|
}
|
||||||
rootEntityBinding.getHierarchyDetails().getEntityIdentifier().createIdentifierGenerator( identifierGeneratorFactory,
|
rootEntityBinding.getHierarchyDetails().getEntityIdentifier().createIdentifierGenerator(
|
||||||
|
identifierGeneratorFactory,
|
||||||
properties );
|
properties );
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetaAttributeContext createMetaAttributeContext( final AttributeBindingContainer attributeBindingContainer,
|
private MetaAttributeContext createMetaAttributeContext(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final AttributeSource attributeSource ) {
|
final AttributeSource attributeSource ) {
|
||||||
return createMetaAttributeContext( attributeSource.metaAttributes(),
|
return createMetaAttributeContext(
|
||||||
|
attributeSource.metaAttributes(),
|
||||||
false,
|
false,
|
||||||
attributeBindingContainer.getMetaAttributeContext() );
|
attributeBindingContainer.getMetaAttributeContext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetaAttributeContext createMetaAttributeContext( final Iterable< MetaAttributeSource > metaAttributeSources,
|
private MetaAttributeContext createMetaAttributeContext(
|
||||||
|
final Iterable< MetaAttributeSource > metaAttributeSources,
|
||||||
final boolean onlyInheritable,
|
final boolean onlyInheritable,
|
||||||
final MetaAttributeContext parentContext ) {
|
final MetaAttributeContext parentContext ) {
|
||||||
final MetaAttributeContext subContext = new MetaAttributeContext( parentContext );
|
final MetaAttributeContext subContext = new MetaAttributeContext( parentContext );
|
||||||
|
@ -1062,19 +1113,22 @@ public class Binder {
|
||||||
return subContext;
|
return subContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SingularAttribute createSingularAttribute( final AttributeBindingContainer attributeBindingContainer,
|
private SingularAttribute createSingularAttribute(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final SingularAttributeSource attributeSource ) {
|
final SingularAttributeSource attributeSource ) {
|
||||||
return attributeSource.isVirtualAttribute()
|
return attributeSource.isVirtualAttribute()
|
||||||
? attributeBindingContainer.getAttributeContainer().createVirtualSingularAttribute( attributeSource.getName() )
|
? attributeBindingContainer.getAttributeContainer().createVirtualSingularAttribute( attributeSource.getName() )
|
||||||
: attributeBindingContainer.getAttributeContainer().createSingularAttribute( attributeSource.getName() );
|
: attributeBindingContainer.getAttributeContainer().createSingularAttribute( attributeSource.getName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private TableSpecification createTable( final TableSpecificationSource tableSpecSource,
|
private TableSpecification createTable(
|
||||||
|
final TableSpecificationSource tableSpecSource,
|
||||||
final DefaultNamingStrategy defaultNamingStrategy ) {
|
final DefaultNamingStrategy defaultNamingStrategy ) {
|
||||||
final LocalBindingContext bindingContext = bindingContexts.peek();
|
final LocalBindingContext bindingContext = bindingContexts.peek();
|
||||||
final MappingDefaults mappingDefaults = bindingContext.getMappingDefaults();
|
final MappingDefaults mappingDefaults = bindingContext.getMappingDefaults();
|
||||||
final Schema.Name schemaName =
|
final Schema.Name schemaName =
|
||||||
new Schema.Name( createIdentifier( tableSpecSource.getExplicitSchemaName(), mappingDefaults.getSchemaName() ),
|
new Schema.Name(
|
||||||
|
createIdentifier( tableSpecSource.getExplicitSchemaName(), mappingDefaults.getSchemaName() ),
|
||||||
createIdentifier( tableSpecSource.getExplicitCatalogName(), mappingDefaults.getCatalogName() ) );
|
createIdentifier( tableSpecSource.getExplicitCatalogName(), mappingDefaults.getCatalogName() ) );
|
||||||
final Schema schema = metadata.getDatabase().locateSchema( schemaName );
|
final Schema schema = metadata.getDatabase().locateSchema( schemaName );
|
||||||
if ( tableSpecSource instanceof TableSource ) {
|
if ( tableSpecSource instanceof TableSource ) {
|
||||||
|
@ -1094,11 +1148,13 @@ public class Binder {
|
||||||
return ( table == null ? schema.createTable( logicalTableId, physicalTableId ) : table );
|
return ( table == null ? schema.createTable( logicalTableId, physicalTableId ) : table );
|
||||||
}
|
}
|
||||||
final InLineViewSource inLineViewSource = ( InLineViewSource ) tableSpecSource;
|
final InLineViewSource inLineViewSource = ( InLineViewSource ) tableSpecSource;
|
||||||
return schema.createInLineView( Identifier.toIdentifier( inLineViewSource.getLogicalName() ),
|
return schema.createInLineView(
|
||||||
|
Identifier.toIdentifier( inLineViewSource.getLogicalName() ),
|
||||||
inLineViewSource.getSelectStatement() );
|
inLineViewSource.getSelectStatement() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityBinding entityBinding( final String entityName ) {
|
private EntityBinding entityBinding(
|
||||||
|
final String entityName ) {
|
||||||
// Check if binding has already been created
|
// Check if binding has already been created
|
||||||
EntityBinding entityBinding = metadata.getEntityBinding( entityName );
|
EntityBinding entityBinding = metadata.getEntityBinding( entityName );
|
||||||
if ( entityBinding == null ) {
|
if ( entityBinding == null ) {
|
||||||
|
@ -1111,14 +1167,15 @@ public class Binder {
|
||||||
: null;
|
: null;
|
||||||
// Create entity binding
|
// Create entity binding
|
||||||
entityBinding =
|
entityBinding =
|
||||||
superEntityBinding == null
|
superEntityBinding == null ? bindEntities( entityHierarchiesByRootEntitySource.get( entitySource ) ) : bindEntity(
|
||||||
? bindEntities( entityHierarchiesByRootEntitySource.get( entitySource ) )
|
entitySource,
|
||||||
: bindEntity( entitySource, superEntityBinding );
|
superEntityBinding );
|
||||||
}
|
}
|
||||||
return entityBinding;
|
return entityBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mapSourcesByName( final EntitySource entitySource ) {
|
private void mapSourcesByName(
|
||||||
|
final EntitySource entitySource ) {
|
||||||
entitySourcesByName.put( entitySource.getEntityName(), entitySource );
|
entitySourcesByName.put( entitySource.getEntityName(), entitySource );
|
||||||
for ( final AttributeSource attributeSource : entitySource.attributeSources() ) {
|
for ( final AttributeSource attributeSource : entitySource.attributeSources() ) {
|
||||||
attributeSourcesByName.put( attributeSource.getName(), attributeSource );
|
attributeSourcesByName.put( attributeSource.getName(), attributeSource );
|
||||||
|
@ -1128,11 +1185,13 @@ public class Binder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private PluralAttributeElementNature pluralAttributeElementNature( final PluralAttributeSource attributeSource ) {
|
private PluralAttributeElementNature pluralAttributeElementNature(
|
||||||
|
final PluralAttributeSource attributeSource ) {
|
||||||
return PluralAttributeElementNature.valueOf( attributeSource.getElementSource().getNature().name() );
|
return PluralAttributeElementNature.valueOf( attributeSource.getElementSource().getNature().name() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private SingularAttributeBinding pluralAttributeKeyBinding( final AttributeBindingContainer attributeBindingContainer,
|
private SingularAttributeBinding pluralAttributeKeyBinding(
|
||||||
|
final AttributeBindingContainer attributeBindingContainer,
|
||||||
final PluralAttributeSource attributeSource ) {
|
final PluralAttributeSource attributeSource ) {
|
||||||
final EntityBinding entityBinding = attributeBindingContainer.seekEntityBinding();
|
final EntityBinding entityBinding = attributeBindingContainer.seekEntityBinding();
|
||||||
final String referencedAttributeName = attributeSource.getKeySource().getReferencedEntityAttributeName();
|
final String referencedAttributeName = attributeSource.getKeySource().getReferencedEntityAttributeName();
|
||||||
|
@ -1151,16 +1210,20 @@ public class Binder {
|
||||||
return ( SingularAttributeBinding ) referencedAttributeBinding;
|
return ( SingularAttributeBinding ) referencedAttributeBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String propertyAccessorName( final AttributeSource attributeSource ) {
|
private String propertyAccessorName(
|
||||||
return attributeSource.getPropertyAccessorName() == null ? bindingContexts.peek().getMappingDefaults().getPropertyAccessorName()
|
final AttributeSource attributeSource ) {
|
||||||
|
return attributeSource.getPropertyAccessorName() == null
|
||||||
|
? bindingContexts.peek().getMappingDefaults().getPropertyAccessorName()
|
||||||
: attributeSource.getPropertyAccessorName();
|
: attributeSource.getPropertyAccessorName();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String quotedIdentifier( final String name ) {
|
private String quotedIdentifier(
|
||||||
|
final String name ) {
|
||||||
return bindingContexts.peek().isGloballyQuotedIdentifiers() ? StringHelper.quote( name ) : name;
|
return bindingContexts.peek().isGloballyQuotedIdentifiers() ? StringHelper.quote( name ) : name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resolveHibernateResolvedType( final HibernateTypeDescriptor hibernateTypeDescriptor,
|
private void resolveHibernateResolvedType(
|
||||||
|
final HibernateTypeDescriptor hibernateTypeDescriptor,
|
||||||
final String typeName,
|
final String typeName,
|
||||||
final AbstractValue value ) {
|
final AbstractValue value ) {
|
||||||
final Properties typeProperties = new Properties();
|
final Properties typeProperties = new Properties();
|
||||||
|
@ -1172,12 +1235,15 @@ public class Binder {
|
||||||
if ( hibernateTypeDescriptor.getJavaTypeName() == null ) {
|
if ( hibernateTypeDescriptor.getJavaTypeName() == null ) {
|
||||||
hibernateTypeDescriptor.setJavaTypeName( resolvedType.getReturnedClass().getName() );
|
hibernateTypeDescriptor.setJavaTypeName( resolvedType.getReturnedClass().getName() );
|
||||||
}
|
}
|
||||||
value.setJdbcDataType( new JdbcDataType( resolvedType.sqlTypes( metadata )[ 0 ], resolvedType.getName(),
|
value.setJdbcDataType( new JdbcDataType(
|
||||||
|
resolvedType.sqlTypes( metadata )[ 0 ],
|
||||||
|
resolvedType.getName(),
|
||||||
resolvedType.getReturnedClass() ) );
|
resolvedType.getReturnedClass() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean toBoolean( final TruthValue truthValue,
|
private boolean toBoolean(
|
||||||
|
final TruthValue truthValue,
|
||||||
final boolean truthValueDefault ) {
|
final boolean truthValueDefault ) {
|
||||||
if ( truthValue == TruthValue.TRUE ) {
|
if ( truthValue == TruthValue.TRUE ) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue