Hi,
I have encountered a problem that I have been struggling with in the past few days without going anywhere. I tried google but didn't get much that is related to the problem I have so I am posting here. Your help will be greatly appreciated.
1. The data model 2. The mappings 3. The problem 4. The Environment
1. The Model:
SPECIFN_LVL - specification level ITSA_ATTR - Attribute SPECIFN_LVL_ATTR - the association table between SPECIFN_LVL and ITSA_ATTR The relationship between SPECIFN_LVL and ITSA_ATTR is many to many.
ITSA_USAGE - usage SPECIFN_LVL_ATTR_USAGE - association table between ITSA_USAGE and SPECIFN_LVL_ATTR The relationship between ITSA_USAGE and SPECIFN_LVL_ATTR is many to many.
2. The mappings
2.1 (SPECIFN_LVL)
@Table(name = "SPECIFN_LVL") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "SPECIFN_LVL_TYP_CD", discriminatorType = DiscriminatorType.STRING) @Entity @TypeDefs( { @TypeDef(name = "statusCode", typeClass = StatusCodeUserType.class), @TypeDef(name = "productHierarchyType", typeClass = ProductHierarchyUserType.class) }) @Where(clause = "SPECIFN_LVL_STUS_CD <> 'DELT'") public abstract class ProductTypeHierarchy extends BaseEntity {
private static final long serialVersionUID = -6906211714885162421L;
@Id @SequenceGenerator(name = "sequence", sequenceName = "SEQ_SPECIFN_LVL") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence") @Column(name = "SPECIFN_LVL_ID") @NotNull protected Long id;
@NotNull @Size(max = 30) @Column(name = "SPECIFN_LVL_CD") protected String code;
@NotNull @Size(max = 50) @Column(name = "SPECIFN_LVL_NM") protected String name;
@NotNull @Size(max = 25) @Column(name = "SPECIFN_LVL_ABBR_DS") protected String abbreviation;
@Size(max = 254) @Column(name = "SPECIFN_LVL_DS") protected String description;
@NotNull @Type(type = "statusCode") @Column(name = "SPECIFN_LVL_STUS_CD") protected StatusCode status = StatusCode.ACTIVE;
@NotNull @Column(name = "SPECIFN_LVL_TYP_CD", updatable = false, insertable = false) @Type(type = "productHierarchyType") protected ProductHierarchyType type;
@ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "PARNT_SPECIFN_LVL_ID") protected ProductTypeHierarchy parent;
@Where(clause = "SPECIFN_LVL_STUS_CD <> 'DELT'") @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "parent") protected final Set<ProductTypeHierarchy> children = Sets.newLinkedHashSet();
@Where(clause = "ITM_TYP_STUS_CD <> 'DELT'") @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "parent") protected final Set<ItemType> itemTypes = Sets.newLinkedHashSet();
@ElementCollection @JoinTable(name = "MDSE_SPECIFN_LVL", joinColumns = { @JoinColumn(name = "SPECIFN_LVL_ID") }) private Set<MerchandiseHierarchyProductHierarchy> merchandiseHierarchies = Sets.newHashSet();
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "id.prodcutTypeHierarchy") private Set<ProductHierarchyAttribute> attributes = Sets.newHashSet();
public void addMerchandiseHierarchy(MerchandiseHierarchy merchandiseHierarchy) { Assert.notNull(merchandiseHierarchy); MerchandiseHierarchyProductHierarchy association = new MerchandiseHierarchyProductHierarchy(merchandiseHierarchy); merchandiseHierarchies.add(association); }
public void removeMerchandiseHierarchy(MerchandiseHierarchy merchandiseHierarchy) { Assert.notNull(merchandiseHierarchy); MerchandiseHierarchyProductHierarchy association = new MerchandiseHierarchyProductHierarchy(merchandiseHierarchy); merchandiseHierarchies.remove(association); }
public List<MerchandiseHierarchy> findMerchandiseHierarchies() { List<MerchandiseHierarchy> list = Lists.newArrayList(); for (MerchandiseHierarchyProductHierarchy each : merchandiseHierarchies) { list.add(each.getMerchandiseHierarchy()); } return Collections.unmodifiableList(list); }
protected ProductTypeHierarchy() { super(); }
protected ProductTypeHierarchy(String code, String name, String abbreviation, ProductHierarchyType type) { super(); this.code = code; this.name = name; this.abbreviation = abbreviation; this.type = type; this.created("1", Calendar.getInstance().getTime()); }
public void addItemType(ItemType itemType) { Assert.notNull(itemType); this.itemTypes.add(itemType); }
public ItemType findItemType(String itemTypeCode) { ItemType retVal = null; for (ItemType val : itemTypes) { if (val.getCode().equalsIgnoreCase(itemTypeCode)) { return val; } } return retVal; }
public void addAttribute(ProductTypeAttribute attribute, Collection<Usage> usages) { Assert.notNull(attribute); Assert.notNull(usages); Assert.isTrue(!usages.isEmpty());
ProductHierarchyAttribute association = new ProductHierarchyAttribute(attribute, this); association.assignUsages(usages); attributes.add(association); }
public void removeAttribute(ProductTypeAttribute attribute) { Assert.notNull(attribute); ProductHierarchyAttribute association = new ProductHierarchyAttribute(attribute, this); attributes.remove(association); }
public String getCode() { return code; }
public String getName() { return name; }
public String getAbbreviation() { return abbreviation; }
public String getDescription() { return description; }
public Set<ProductTypeHierarchy> getChildren() { return children; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((code == null) ? 0 : code.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProductTypeHierarchy other = (ProductTypeHierarchy) obj; if (code == null) { if (other.code != null) return false; } else if (!code.equals(other.code)) return false; return true; }
public Long getId() { return id; }
public ProductTypeHierarchy getParent() { return parent; }
public StatusCode getStatus() { return status; }
public void setStatus(StatusCode status) { this.status = status; }
public void setName(String name) { this.name = name; }
public void setAbbreviation(String abbreviation) { this.abbreviation = abbreviation; }
public void setDescription(String description) { this.description = description; }
public Set<ProductHierarchyAttribute> getAttributes() { return attributes; }
public Collection<ItemType> getItemTypes() { return itemTypes; }
}
2.2 (ITSA_ATTR)
@TypeDefs( { @TypeDef(name = "statusCode", typeClass = StatusCodeUserType.class), @TypeDef(name = "valueType", typeClass = AttributeValueTypeUserType.class), @TypeDef(name = "attributeSingleMultiSelect", typeClass = AttributeSingleMultiSelectUserType.class) }) @Entity @Table(name = "ITSA_ATTR") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "ATTR_TYP_CD", discriminatorType = DiscriminatorType.STRING) @Where(clause = "ATTR_STUS_CD <> 'DELT'") public abstract class Attribute extends BaseEntity {
private static final long serialVersionUID = -1867821986013939223L;
@Id @Column(name = "ATTR_CD") private String code;
@Column(name = "ATTR_NM") private String name;
@Column(name = "ATTR_TYP_CD", insertable = false, updatable = false) private String type;
@Column(name = "ATTR_ABBR_NM") private String abbreviatedName;
@NotNull @Type(type = "statusCode") @Column(name = "ATTR_STUS_CD") private StatusCode status = StatusCode.ACTIVE;
@Column(name = "DFALT_ATTR_DATA_TYP_CD") @Type(type = "valueType") private AttributeValueType valueType;
@Column(name = "ATTR_DS") private String description;
@Type(type = "yes_no") @Column(name = "MULT_SELN_ELIGBTY_IN") @Basic private boolean allowMultipleSelection;
@Type(type = "yes_no") @Column(name = "ATTR_BOOLEAN_IN") @Basic private boolean freeformAttribute = false;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval=true, mappedBy = "valueId.attribute") private Set<AllowableValue> allowableValues = Sets.newHashSet();
public Attribute(String attributeName, String description) { this(attributeName, null, description, AttributeValueType.Select, false); }
public Attribute(String attributeName, String abbreviatedName, String description, AttributeValueType valueType, boolean allowMultipleSelection) { name = attributeName; code = attributeName; this.setAbbreviatedName(abbreviatedName); this.setDescription(description); this.valueType = valueType; this.allowMultipleSelection = allowMultipleSelection; this.created("1", Calendar.getInstance().getTime()); this.status = StatusCode.ACTIVE; }
public Attribute() { super(); }
public String getId() { return code; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public void setDescription(String description) { this.description = description; }
public void setValueType(AttributeValueType valueType) { this.valueType = valueType; }
public String getDescription() { return description; }
public String getType() { return type; }
public StatusCode getStatus() { return status; }
public void setStatus(StatusCode status) { this.status = status; }
public void setAllowMultipleSelection(boolean allowMultipleSelection) { this.allowMultipleSelection = allowMultipleSelection; }
public boolean isAllowMultipleSelection() { return allowMultipleSelection; }
public void allowMultipleSelections() { this.allowMultipleSelection = true; }
public AttributeValueType getValueType() { return valueType; }
public boolean isOfDataType(AttributeValueType attributeValueType) { return attributeValueType == valueType; }
public AllowableValue addAllowableValue(String value) { AllowableValue allowableValue = new AllowableValue(value, this); this.allowableValues.add(allowableValue); return allowableValue; }
public AllowableValue addAllowableValue(AllowableValue allowableValue) { this.allowableValues.add(allowableValue); return allowableValue; }
public AllowableValue addAllowableValue(String value, String abbreviatedCode) { AllowableValue allowableValue = new AllowableValue(this, value, abbreviatedCode); this.allowableValues.add(allowableValue); return allowableValue; }
public Collection<AllowableValue> getAllowableValues() { return unmodifiableCollection(allowableValues); }
public AllowableValue findAllowableValue(final String value) { return Iterables.find(allowableValues, new Predicate<AllowableValue>() { public boolean apply(AllowableValue allowableValue) { return allowableValue.getValue().equals(value); } }); }
public void removeValue(String value) { AllowableValue allowableValue = findAllowableValue(value); allowableValues.remove(allowableValue); }
public AllowableValue addDefaultValue(String value, String abbreviatedCode) { makeNoValueToBeDefault(); AllowableValue allowableValue = addAllowableValue(value, abbreviatedCode); allowableValue.makeDefaultValue(); return allowableValue; }
public void makeNoValueToBeDefault() { for (AllowableValue val : getAllowableValues()) { val.resetDefaultValue(); } }
public boolean isOfType(AttributeSingleMultiSelect attributeSingleMultiSelect) { if (attributeSingleMultiSelect == AttributeSingleMultiSelect.MultiSelect && allowMultipleSelection) return true; else if (attributeSingleMultiSelect == AttributeSingleMultiSelect.MultiSelect) return false; return true; }
public boolean isFreeFormAttribute() { return allowableValues.size() == 0; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((valueType == null) ? 0 : valueType.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Attribute other = (Attribute) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equalsIgnoreCase(other.name)) return false; if (valueType == null) { if (other.valueType != null) return false; } else if (!valueType.equals(other.valueType)) return false; return true; }
@Override public String toString() { return reflectionToString(this, SIMPLE_STYLE).toString(); }
public void setAbbreviatedName(String abbreviatedName) { this.abbreviatedName = abbreviatedName; }
public String getAbbreviatedName() { return abbreviatedName; } }
2.3(SPECIFN_LVL_ATTR)
@Entity @Table(name = "SPECIFN_LVL_ATTR") class ProductHierarchyAttribute extends BaseEntity {
private static final long serialVersionUID = 1L;
@Id private ProductHierarchyAttributeId id;
@ElementCollection @JoinTable(name = "SPECIFN_LVL_ATTR_USAGE", joinColumns = { @JoinColumn(name = "SPECIFN_LVL_ID"), @JoinColumn(name = "SPECIFN_ROLE_CD"), @JoinColumn(name = "ATTR_CD") }) private Set<ProductHierarchyAttributeUsage> usages = Sets.newHashSet();
ProductHierarchyAttribute() { }
ProductHierarchyAttribute(ProductTypeAttribute attribute, ProductTypeHierarchy productTypeHierarchy) { this.created("1", Calendar.getInstance().getTime()); this.id = new ProductHierarchyAttributeId(attribute, productTypeHierarchy); }
public ProductTypeAttribute getAttribute() { return id.attribute; }
public ProductTypeHierarchy getProductTypeHierarchy() { return id.prodcutTypeHierarchy; }
public void assignUsage(Usage usage) { usages.add(new ProductHierarchyAttributeUsage(usage.getCode())); }
public void assignUsages(Collection<Usage> usages) { for (Usage usage : usages) { assignUsage(usage); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProductHierarchyAttribute other = (ProductHierarchyAttribute) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; }
@Embeddable public static class ProductHierarchyAttributeId implements Serializable {
private static final long serialVersionUID = 1L;
@ManyToOne(optional = false) @JoinColumn(name = "ATTR_CD") protected ProductTypeAttribute attribute;
@ManyToOne(optional = false) @JoinColumn(name = "SPECIFN_LVL_ID") protected ProductTypeHierarchy prodcutTypeHierarchy;
@NotNull @Column(name = "SPECIFN_ROLE_CD") protected String attributeroleCode = "DFLT";
ProductHierarchyAttributeId() { }
public ProductHierarchyAttributeId(ProductTypeAttribute attribute, ProductTypeHierarchy prodcutTypeHierarchy) { this.attribute = attribute; this.prodcutTypeHierarchy = prodcutTypeHierarchy; }
public ProductTypeAttribute getAttribute() { return attribute; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((attribute == null) ? 0 : attribute.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProductHierarchyAttributeId other = (ProductHierarchyAttributeId) obj; if (attribute == null) { if (other.attribute != null) return false; } else if (!attribute.equals(other.attribute)) return false; return true; }
} }
2.4 (ITSA_USAGE)
@Entity @Table(name = "ITSA_USAGE") @TypeDefs( { @TypeDef(name = "statusCode", typeClass = StatusCodeUserType.class) }) public class Usage extends BaseEntity {
private static final long serialVersionUID = -1113051290989273714L;
@Id @Column(name = "USAGE_CD") @NotNull private String code;
@Column(name = "USAGE_NM") @NotNull private String name;
@Column(name = "USAGE_STUS_CD") @NotNull @Type(type = "statusCode") private StatusCode statusCode;
@Column(name = "USAGE_RQD_IN") @NotNull private String required;
protected Usage() { }
public Usage(String code, String name) { this(code, name, StatusCode.ACTIVE, "Y"); }
public Usage(String code, String name, StatusCode statusCode, String rquired) { this.code = code; this.name = name; this.statusCode = StatusCode.ACTIVE; this.required = "Y"; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((code == null) ? 0 : code.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Usage other = (Usage) obj; if (code == null) { if (other.code != null) return false; } else if (!code.equals(other.code)) return false; return true; }
public String getId() { return getCode(); }
public String getCode() { return code; }
public String getName() { return name; }
public StatusCode getStatusCode() { return statusCode; }
public String getRequired() { return required; }
}
2.5 (SPECIFN_LVL_ATTR_USAGE)
@Embeddable public class ProductHierarchyAttributeUsage extends BaseAuditable {
private static final long serialVersionUID = 7700347442714463418L;
@Column(name = "USAGE_CD", updatable = false) private String usageCode;
protected ProductHierarchyAttributeUsage() { }
public ProductHierarchyAttributeUsage(String usageCode) { this.usageCode = usageCode; this.created("1", Calendar.getInstance().getTime()); }
public String getUsageCode() { return usageCode; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((usageCode == null) ? 0 : usageCode.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProductHierarchyAttributeUsage other = (ProductHierarchyAttributeUsage) obj; if (usageCode == null) { if (other.usageCode != null) return false; } else if (!usageCode.equals(other.usageCode)) return false; return true; }
}
3. The problem
With the mappings above when I tried to insert to SPECIFN_LVL_ATTR_USAGE using Data Access Object I got the following excpetion:
Hibernate: insert into IZITSAD2.ITSA_USAGE (CHANGE_TS, CHANGE_USER_ID, CREATE_TS, CREATE_USER_ID, ITSA_VER_NB, USAGE_NM, USAGE_RQD_IN, USAGE_STUS_CD, USAGE_CD) values (?, ?, ?, ?, ?, ?, ?, ?, ?) Hibernate: SELECT nextval FOR IZITSAD2.SEQ_SPECIFN_LVL FROM sysibm.sysdummy1 Hibernate: insert into IZITSAD2.ITSA_ATTR (CHANGE_TS, CHANGE_USER_ID, CREATE_TS, CREATE_USER_ID, ITSA_VER_NB, ATTR_ABBR_NM, MULT_SELN_ELIGBTY_IN, ATTR_DS, ATTR_BOOLEAN_IN, ATTR_NM, ATTR_STUS_CD, DFALT_ATTR_DATA_TYP_CD, ATTR_TYP_CD, ATTR_CD) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'PRDA', ?) Hibernate: insert into IZITSAD2.SPECIFN_LVL (CHANGE_TS, CHANGE_USER_ID, CREATE_TS, CREATE_USER_ID, ITSA_VER_NB, SPECIFN_LVL_ABBR_DS, SPECIFN_LVL_CD, SPECIFN_LVL_DS, SPECIFN_LVL_NM, PARNT_SPECIFN_LVL_ID, SPECIFN_LVL_STUS_CD, SPECIFN_LVL_TYP_CD, SPECIFN_LVL_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'PRDT', ?) Hibernate: insert into IZITSAD2.SPECIFN_LVL_ATTR (CHANGE_TS, CHANGE_USER_ID, CREATE_TS, CREATE_USER_ID, ITSA_VER_NB, ATTR_CD, SPECIFN_ROLE_CD, SPECIFN_LVL_ID) values (?, ?, ?, ?, ?, ?, ?, ?) Hibernate: insert into IZITSAD2.SPECIFN_LVL_ATTR_USAGE (SPECIFN_LVL_ID, SPECIFN_ROLE_CD, ATTR_CD, USAGE_CD, CHANGE_TS, CHANGE_USER_ID, CREATE_TS, CREATE_USER_ID) values (?, ?, ?, ?, ?, ?, ?, ?) Sep 9, 2010 9:19:26 AM org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: -99999, SQLState: null Sep 9, 2010 9:19:26 AM org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: Invalid data conversion: Parameter instance Fabric is invalid for requested conversion. Sep 9, 2010 9:19:26 AM org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: could not insert collection: [com.itsa.domain.ProductHierarchyAttribute.usages#component[attribute,attributeroleCode,prodcutTypeHierarchy]{attributeroleCode=DFLT, prodcutTypeHierarchy=com.itsa.domain.ProductTypeHierarchy#30050, attribute=com.itsa.domain.attribute.ProductTypeAttribute#Fabric}] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1244) at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:58) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:267) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:259) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:182) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206) at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:791) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365) at $Proxy64.flush(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240) at $Proxy64.flush(Unknown Source) at com.itsa.persistence.base.JPATransactor.perform(JPATransactor.java:18) at com.itsa.read.repository.internal.AttributeRepositoryImplTest.addAttribute(AttributeRepositoryImplTest.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: com.ibm.db2.jcc.a.SqlException: Invalid data conversion: Parameter instance Fabric is invalid for requested conversion. at com.ibm.db2.jcc.a.q.a(q.java:678) at com.ibm.db2.jcc.a.q.a(q.java:1180) at com.ibm.db2.jcc.a.cz.a(cz.java:1030) at com.ibm.db2.jcc.a.cz.bi(cz.java:2707) at com.ibm.db2.jcc.a.cz.d(cz.java:1758) at com.ibm.db2.jcc.a.cz.d(cz.java:2127) at com.ibm.db2.jcc.a.cz.T(cz.java:456) at com.ibm.db2.jcc.a.cz.executeUpdate(cz.java:439) at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102) at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1207) ... 51 more
4. The environment Hibernate:3.5.5-FINAL Database: IBM DB2 Java:1.5
Thanks in advance for your help!
Casey
|