Reputation:
I have a table which has the primary key of type BIGINT UNSIGNED. Now, how can I model this key in JPA? If I use java.math.BigInteger, JPA will not accept it. If I use Long, then the type of JPA seems to be too small in comparison with the type of MySQL. What if the number of records exceeds Long.MAX_VALUE ?
Upvotes: 1
Views: 184
Reputation: 308743
You should use Long and sleep at night. Look at the max value for a long. If your table ever comes close to that number I'd be surprised. I know we live in the era of Big Data, but your fears are overblown and unrealistic in the near term.
Upvotes: 2