Issue
What can i do so JPA (i use Hibernate) creates Columns with Unsigned types? Currently all my ID columns are signed.
Solution
Using the href="http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#entity-mapping-property-column">columnDefinition
property on the @Column
annotation should do it. Taking a total guess at the SQL type you're going for:
private long foo;
@Column(columnDefinition = "UNSIGNED INT(11)")
public long getFoo()
{
return foo;
}
N.B. Not all databases (like SQL Server, I think) support unsigned int types.
Answered By - Matt Ball
Answer Checked By - Katrina (JavaFixing Volunteer)