Illegal SQL code generated for batch UPDATE if component user type (CompositeUserType) is used.

Description

I have a "Billing" class with a field of type "Username" declared as:

@CheckForNull
@Columns(columns={@Column(name="processed_by_provider"), @Column(name="processed_by_name")})
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");
config.registerTypeOverride(new PersistentUsername());
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");
u.setParameter("uname", username);
u.setParameter("u", id);
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=?

Environment

None

Status

Assignee

Unassigned

Reporter

Rodion Alukhanov

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.3.6
4.3.7

Priority

Major