I have a "Billing" class with a field of type "Username" declared as:
private Username processedBy;
Class "Username" is a simple POJO with two fields: "provider" and "name".
The implementation of CompositeUserType interface is straightforward and attached to the issue. It is registered globally as:
Configuration config = new Configuration().configure("hibernate.cfg.xml");
SessionFactory result = config.buildSessionFactory();
It works fine as long I am using classical hibernate functionality, but not with batch processing. HQL for batch update:
u = session.createQuery("UPDATE Billing r SET r.processedBy = :uname WHERE r.id = :u");
int count = u.executeUpdate();
Generate the following illegal SQL:
update billing set processed_by_provider, processed_by_name=(?, ?) where id=?
Expected is something like this:
update billing set processed_by_provider=?, processed_by_name=? where id=?