diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeKeySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeKeySourceImpl.java index 15c631cbbe..ca62225e8b 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeKeySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeKeySourceImpl.java @@ -49,18 +49,6 @@ public class PluralAttributeKeySourceImpl implements PluralAttributeKeySource { this.deleteAction = attribute.getOnDeleteAction() == OnDeleteAction.CASCADE ? ForeignKey.ReferentialAction.CASCADE : ForeignKey.ReferentialAction.NO_ACTION; } - - @Override - public List getValueSources() { - List valueSources = new ArrayList(); - if ( !attribute.getJoinColumnValues().isEmpty() ) { - for ( Column columnValues : attribute.getColumnValues() ) { - valueSources.add( new ColumnSourceImpl( attribute, null, columnValues ) ); - } - } - return valueSources; - } - @Override public ForeignKey.ReferentialAction getOnDeleteAction() { return deleteAction; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/util/JandexHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/util/JandexHelper.java index 821e9ae88e..5a6359ad4d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/util/JandexHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/util/JandexHelper.java @@ -111,7 +111,7 @@ public class JandexHelper { catch ( ClassCastException e ) { throw new AssertionFailure( String.format( - "the annotation property %s of annotation %s is not of type %s", + "the annotation property [%s] of annotation [@%s] is not of type %s", element, annotation.name(), type.getName() diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractPluralAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractPluralAttributeSourceImpl.java index 84626d8017..5d986b342e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractPluralAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractPluralAttributeSourceImpl.java @@ -148,6 +148,11 @@ public abstract class AbstractPluralAttributeSourceImpl return elementSource; } + @Override + public String getMappedBy() { + return null; + } + @Override public String inferInLineViewName() { return container().getPath() + "." + pluralAttributeElement.getName(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/PluralAttributeKeySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/PluralAttributeKeySourceImpl.java index ca5c30edc8..6895bdf969 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/PluralAttributeKeySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/PluralAttributeKeySourceImpl.java @@ -81,11 +81,6 @@ public class PluralAttributeKeySourceImpl ); } - @Override - public List getValueSources() { - return valueSources; - } - @Override public String getExplicitForeignKeyName() { return keyElement.getForeignKey(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/PluralAttributeKeyBinding.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/PluralAttributeKeyBinding.java index 288cbc20fc..96b6706751 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/PluralAttributeKeyBinding.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/PluralAttributeKeyBinding.java @@ -23,8 +23,6 @@ */ package org.hibernate.metamodel.spi.binding; -import java.util.List; - import org.hibernate.AssertionFailure; import org.hibernate.metamodel.spi.relational.Column; import org.hibernate.metamodel.spi.relational.ForeignKey; @@ -43,7 +41,7 @@ public class PluralAttributeKeyBinding { private boolean isIncludedInUpdate; // this knowledge can be implicitly resolved based on the typing information on the referenced owner attribute - private final HibernateTypeDescriptor hibernateTypeDescriptor = new HibernateTypeDescriptor(); + private HibernateTypeDescriptor hibernateTypeDescriptor = new HibernateTypeDescriptor(); // todo : this would be nice to have but we do not always know it, especially in HBM case. @@ -102,6 +100,10 @@ public class PluralAttributeKeyBinding { return hibernateTypeDescriptor; } + public void setHibernateTypeDescriptor(HibernateTypeDescriptor hibernateTypeDescriptor) { + this.hibernateTypeDescriptor = hibernateTypeDescriptor; + } + public void setForeignKey(ForeignKey foreignKey) { if ( foreignKey == null ) { throw new AssertionFailure( "foreignKey argument must be non-null." ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeKeySource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeKeySource.java index a41dd3fee8..8e716018bb 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeKeySource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeKeySource.java @@ -33,7 +33,5 @@ import org.hibernate.metamodel.spi.relational.ForeignKey; * @author Steve Ebersole */ public interface PluralAttributeKeySource extends ForeignKeyContributingSource, RelationalValueSourceContainer { - public List getValueSources(); - public ForeignKey.ReferentialAction getOnDeleteAction(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeSource.java index 861c48ea81..70085ec20d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeSource.java @@ -66,6 +66,8 @@ public interface PluralAttributeSource public CustomSQL getCustomSqlDeleteAll(); + public String getMappedBy(); + /** * Describes the nature of the collection itself as declared by the metadata. *