How can a I create an field on my class thats autoIncremented from zero to 255
to create a sequence on JPA I normaly use this @GeneratedValue(strategy=GenerationType.AUTO) @SequenceGenerator(name="example_sequence", sequenceName="example_sequence")
But I want to create a sequence that is also generated automatically but it increments from 0 to 255 and when this value is acheived it restarts from zero
you will need to create your own sequence generator
http://www.objectdb.com/api/java/jpa/SequenceGenerator
http://openjpa.apache.org/builds/1.1.0/docs/jpa_overview_mapping_sequence.html
http://blog.cyclopsgroup.org/2007/04/custom-idgenerator-for-jpa-gap-between.html
链接地址: http://www.djcxy.com/p/90890.html