Ashu
Ashu

Reputation: 402

PostgreSQL with Grails auto increment issue

class abc{

   Integer id
   String name
}   

class xyz {


   Integer id
   Integer project_id
   String name
}

When I save object of abc object save successfully with some id (say 12 ) now when I save object of xyz its id increment to (abc.id+1).

Upvotes: 4

Views: 868

Answers (1)

Nickmancol
Nickmancol

Reputation: 1044

Grails uses a sequence [hibernate_sequence] to assing the id for the new objects persisted to the database, is you want to assign a different kind of id you should read the grails docs.

Upvotes: 2

Related Questions