Hibernate requires a no-args constructor in all languages that support method overloading, which is probably not a problem, but I ran into a really annoying problem in ColdFusion ORM (which relies on Hibernate under the hood).
If I declare a custom constructor (init method) for my entities and that some arguments are required for the constructor, Hibernate does not rehydrate my objects because it calls the calling constructor.
Because of this behavior, it seems almost impossible to create always valid objects and, therefore, CF-ORM is almost completely useless.
The only thing I found was to declare another custom method that I use as a constructor that makes instantiation objects now look like new SomeEntity().construct(...)or createObject('component', 'SomeEntity').construct(...). This is pretty cumbersome ...
Which is very stupid is that you can initiate an entity without calling a method initwith createObject, so I wonder why they decided to force Hibernate to call the method initin their implementation, given the fact that it does not even pass parameters and then sets them in other ways .
Anyway, is there any other work for this problem?
EDIT:
I filed an error in Adobe Bugbase .
plalx