• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPA - How to specify precision in automatically created SEQUENCE table?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JPA with TopLink to automatically create Derby database tables. The problem I've encountered is with the automatically created SEQUENCE table that TopLink uses for generating Id numbers for the keys in several of these tables. Specifically, the SEQUENCE table's SEQ_COUNT field is defined as a DECIMAL(5,0) by default. This limits the generated id number to about 99901. However, after populating the database, I've exceeded the maximum number that the SEQ_COUNT field will support by the default: DECIMAL(5,0). To fix this, I had to manually delete the SEQUENCE table and manually recreate it using DECIMAL(31,0) to define the SEQ_COUNT field.

For each table in my database, I have the annotations for the Id as follows:



I cannot find any documentation that explains how to specify the precision for the SEQ_COUNT field for the SEQUENCE table (that is automatically generated by TopLink/JPA). So, my question(s) are:

(1) Is there a way to specify a JPA annotation that can specify the precision of the SEQ_COUNT field?
(2) If not, what would be a best practice to deal with this situation. Certainly I can't be the first person to encounter this limitation.

Any help/suggestions will be greatly appreciated!
Barry
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic