Linked Questions

1 vote
0 answers
231 views

I'm working on employees database. Each one of them needs to have it's unique employee number in 5 digit format. It doesn't have to, but can be corelated with id number in database. I was trying to ...
s-kaczmarek's user avatar
0 votes
0 answers
159 views

I use last H2 (current master) and Hibernate 5.14.14 as JPA provider. I have the following column in table: ID INT NOT NULL AUTO_INCREMENT and the following field in entity: @Column(name = "ID") @...
user avatar
0 votes
0 answers
95 views

When I save a new entity on a MariaDB database with the PK and another field auto generated by the database, the entity is persisted correctly but the instance returned by Hibernate has inverted the ...
Cedric's user avatar
  • 1
19 votes
3 answers
23k views

I'm trying to use generated UUIDs without @Id annotation, because my primary key is something else. The application does not generate an UUID, do you have an idea? This is my declaration: @Column(...
Florian Mozart's user avatar
10 votes
6 answers
28k views

public class SequenceControlNumber extends SequenceGenerator { private static final Logger log = LoggerFactory.getLogger(SequenceGenerator.class); @Override public Serializable ...
B. TIger's user avatar
  • 560
6 votes
4 answers
36k views

I have a JPA 2 web application (Struts 2, Hibernate 4 as JPA implementation only). The current requirement is to add a (non-id) numeric sequential field, filled for certain rows only, to an existing ...
Andrea Ligios's user avatar
4 votes
3 answers
22k views

I want a JPA/Hibernate (preferably JPA) annotation that can generate the value of a column, that is not a primary key and it doesn't start from 1. From what I have seen JPA cannot do that with @...
mist's user avatar
  • 1,863
9 votes
5 answers
16k views

In a Spring Boot project I have a JPA entity, like this: @Entity public class Account { } and then I have the repository to query the database: public interface AccountRepository extends ...
Pablo Fernandez's user avatar
7 votes
2 answers
32k views

I have a class mapped as an Entity to persist it in a database. I have an id field as the primary key so every time the object is persisted the value of the id is retrieved from the sequence "...
Javi's user avatar
  • 19.9k
7 votes
2 answers
5k views

I'm new to Grails. I have a field in my domain object which I define as an String. String ponum When i click first time on create page ,the "ponum" field has to display 0001 and later it has to save ...
Sathish Kumar's user avatar
6 votes
1 answer
13k views

Background I'm writing a project using Spring MVC (Framework v4.0.6.RELEASE, JPA v1.6.2.RELEASE) and Hibernate (Core v4.3.6.FINAL, JPA API v2.1). In my project, there are entities called 'Project'. ...
aemreunal's user avatar
6 votes
2 answers
8k views

I am attempting to persist an entity with an attribute that I want to be populated from a DB sequence. I'm using Oracle, have created the sequence, verified the sequence works via sql, and yet my ...
fmpdmb's user avatar
  • 1,410
4 votes
3 answers
7k views

Basically, I want a way to access sequence values in a database-neutral way. The use case is that I have a field on an entity that I want to set based on an incrementing value (other than the id). ...
jmo's user avatar
  • 472
3 votes
2 answers
5k views

I have the entity of some BusinessParticipant, it just simple flat entity. And these Participants may be organized in groups, by user's wish. The group has no data, just id. So creating entity and ...
ellabi's user avatar
  • 51
3 votes
1 answer
5k views

I would like to make a unique field "number" with autogeneration(autoincrement, last number + 1). But it is not an id field. How can i reach that? @GeneratedValue doesn't work. Only id was generated. ...
Vytsalo's user avatar
  • 778

15 30 50 per page