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

View File

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