HHH-7755 Support Map/Set/List/Bag in component attribute source

This commit is contained in:
brmeyer 2012-11-05 15:31:28 -05:00
parent 4c22d9347f
commit 3db62f5e76
2 changed files with 24 additions and 15 deletions

View File

@ -106,7 +106,7 @@ public abstract class AbstractComponentAttributeSourceImpl extends AbstractHbmSo
protected AttributeSource buildAttributeSource(JaxbManyToOneElement attributeElement) { protected AttributeSource buildAttributeSource(JaxbManyToOneElement attributeElement) {
return new ManyToOneAttributeSourceImpl( return new ManyToOneAttributeSourceImpl(
sourceMappingDocument(), sourceMappingDocument(),
JaxbManyToOneElement.class.cast( attributeElement ), attributeElement,
logicalTableName, logicalTableName,
naturalIdMutability naturalIdMutability
); );
@ -133,20 +133,32 @@ public abstract class AbstractComponentAttributeSourceImpl extends AbstractHbmSo
} }
// todo duplicated with org.hibernate.metamodel.internal.source.hbm.AbstractEntitySourceImpl // todo duplicated with org.hibernate.metamodel.internal.source.hbm.AbstractEntitySourceImpl
protected AttributeSource buildAttributeSource(JaxbMapElement attributeElement){ protected AttributeSource buildAttributeSource(JaxbMapElement attributeElement){
// todo : implement return new MapAttributeSource(
throw new NotYetImplementedException(); sourceMappingDocument(),
attributeElement,
parentContainer
);
} }
protected AttributeSource buildAttributeSource(JaxbSetElement attributeElement) { protected AttributeSource buildAttributeSource(JaxbSetElement attributeElement) {
// todo : implement return new SetAttributeSourceImpl(
throw new NotYetImplementedException(); sourceMappingDocument(),
attributeElement,
parentContainer
);
} }
protected AttributeSource buildAttributeSource(JaxbListElement attributeElement) { protected AttributeSource buildAttributeSource(JaxbListElement attributeElement) {
// todo : implement return new ListAttributeSource(
throw new NotYetImplementedException(); sourceMappingDocument(),
attributeElement,
parentContainer
);
} }
protected AttributeSource buildAttributeSource(JaxbBagElement attributeElement) { protected AttributeSource buildAttributeSource(JaxbBagElement attributeElement) {
// todo : implement return new BagAttributeSourceImpl(
throw new NotYetImplementedException(); sourceMappingDocument(),
attributeElement,
parentContainer
);
} }
protected AttributeSource buildAttributeSource(JaxbArrayElement attributeElement) { protected AttributeSource buildAttributeSource(JaxbArrayElement attributeElement) {
// todo : implement // todo : implement

View File

@ -23,20 +23,17 @@
*/ */
package org.hibernate.test.component.cascading.collection; package org.hibernate.test.component.cascading.collection;
import static org.junit.Assert.assertEquals;
import java.util.Locale; import java.util.Locale;
import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase { public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {