Selvakumar Ponnusamy
Selvakumar Ponnusamy

Reputation: 5563

Create long types in JPA entities

I'm trying to generate JPA entities from tables using eclipse plugins, I defined some BIG INT and Date columns. I would like to have long type in Entity class for those BIGINT columns, But It generates as String. Please help me how to resolve it?

Upvotes: 0

Views: 365

Answers (2)

dpnmn
dpnmn

Reputation: 543

Sounds really weird that the Eclipse plugin generates those columns as String - check that you haven't missed / misread something.

If the column really is a BIG INTEGER in the database, just changing the type of the property field to Long should do the trick.

Upvotes: 1

Nurlan
Nurlan

Reputation: 625

I don't know exactly what do you mean long properties, but try to use @Type annotation. Example: @Type(type = "org.hibernate.type.LongType")

Upvotes: 0

Related Questions