I have the following domain object
@Table(uniqueConstraints={@UniqueConstraint(columnNames={"name", "company_id", "global"}, name="UC_name_companyId_global")})
@Entity
@Audited
public class AccessLevel implements Serializable, GlobalEntityInstance {
private static final long serialVersionUID = -7215569721971710808L;
@Size(min = 2)
@Column(nullable = false)
private String name;
@ManyToOne(optional = false)
private Company company;
@Column
private boolean global = false;
@Column(nullable = false)
private GeneralStatus status;
}
The company
attribute is mapped to column company_id
.
I've created a test case to test that when an Access Level is added with the same 'name', 'company' and 'global' value a DataIntegrityViolationException
is thrown.
The excetion is being thrown, my questions is about the message:
o.h.engine.jdbc.spi.SqlExceptionHelper : Duplicate entry 'Temp Level-1-\x00' for key 'UC_name_companyId_global'
What in the heck is '\x00' (or '\x01' if true is saved) and why does the SqlExceptionHelper map/resolve a boolean value to it? Shouldnt the Duplicate entry key be 'Temp Level-1-false'?
Thanks in advance, Grant
UPDATE:
Im currently using MySQl 5.6