Hi all,
In our existing database, which we can't change, there are some columns defined as char(240).
Hibernate pre 3.6.8 could not handle this well, so we had to upgrade to hibernate 3.6.8
3.6.* features an overhaul of the TypeFactory, so where you used to do:
Code:
NullableType type = (NullableType) TypeFactory.basic(identifierType.getName());
You now do something like:
Code:
BasicType type = new TypeResolver().basic(identifierType.getName());
Now because the @Type is pointed at my custom "UserType" class, the following function requires to be implemented:
Code:
public int[] sqlTypes()
Since TypeResolver().basic always returned a NullableType based class, using the pre 3.6.* hibernate we could use, :
Code:
@Override
public int[] sqlTypes() {
// type is here of type NullableType
return new int[]{type.sqlType()
};
Using the 3.6.* hibernate, we get a BasicType class, which can either be a PrimitiveType, NullableType or SingleColumnType.
Both NullableType(which is actually deprecated now) and SingleColumnType describe the sqlType() function to be implemented, but the PrimitiveType does not and neither does the BasicType class.
In the Type class the following function
is available:
Code:
public int[] sqlTypes(Mapping mapping)
Now to my questionIs the BasicType and/or PrimitiveType class missing the defined sqlType() declaration?
And/or if I should be using the
Code:
public int[] sqlTypes(Mapping mapping)
function, how do I actually get that Mapping class?
Personally I'd say, sqlType() should be present in the interface classes BasicType & PrimitiveType, but I know too little of the entire Hibernate internals to be the judge of that.
Thanks in advance.
Regards,
Marco