It seems there are two different versions of the same error code ORA-24816: one says simply that there is a non-LOB column (of any type, even numeric) after a LOB column, and the other says that there are more than 4000 bytes of data (in one or more columns) after a LOB column, which seems a bit more "tolerant". The second seems to be more common, maybe the first happens with older drivers (9 I would say) and the second with newer drivers (10/11), but I'm not completely sure.
Anyway, to patch this entirely in hibernate I think it should be something like this:
add a isLob attribute in the Property bean. It might be useful anyway, I don't know why that information is not available.
extend the Configuration.secondPassCompile to accept also SecondPass defined in the dialect.
add a specific SecondPass to the Oracle dialect that will re-order properties in the entityMapping pushing the Lobs at the end (by reflection or by wrapping the property iterator again).
It seems there are two different versions of the same error code ORA-24816: one says simply that there is a non-LOB column (of any type, even numeric) after a LOB column, and the other says that there are more than 4000 bytes of data (in one or more columns) after a LOB column, which seems a bit more "tolerant". The second seems to be more common, maybe the first happens with older drivers (9 I would say) and the second with newer drivers (10/11), but I'm not completely sure.
Anyway, to patch this entirely in hibernate I think it should be something like this:
What do you think?