The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

rupscha (1) [Avatar] Offline
#1
Hi,

I was trying to compile ORMUnit but without luck. I'm using hibernate 3.0.5.

For HibernateMappingTests.assertAllFieldsMapped(...) the compiler says:

"The method getProperty(String) is undefined for the type Component" at line 195

While I'm understood what's going on there, I do not know enough about hibernate to fix this.

regards
ceracm (113) [Avatar] Offline
#2
Re: Compiling ORMUnit
Alexander,

Thanks for trying ORMUnit/Hibernate. It looks like ORMUnit is using a Hibernate 3.1 method. Try replacing:

// try {
// Property p = cv.getProperty(fieldName);
// mappedFields.add(fieldName);
// } catch (MappingException e) {
// unmappedFields.add(fieldName);
// }


with

boolean found = false;
Iterator it2 = cv.getPropertyIterator();
while (it2.hasNext()) {
Property p1 = (Property) it2.next();
if (p1.getName().equals(fieldName)) {
found = true;
break;
}
}
if (found)
mappedFields.add(fieldName);
else
unmappedFields.add(fieldName);

This code iterates through the properties looking for the fieldName.

Chris
Jozic (1) [Avatar] Offline
#3
Re: Compiling ORMUnit
And what about compiling ORMUnit with Hibernate 2? Is it possible?
ceracm (113) [Avatar] Offline
#4
Re: Compiling ORMUnit
To be honest. I have no idea what would be required to make it compile with Hibernate 2. My memory of Hibernate2 is a little fuzzy. smilie For example, I think the package names changed along the way. I can't remember whether the APIs that ORMUnit relies on have changed significantly.

Sorry to be so vague..

Chris