Skip to content

Commit

Permalink
will now use the sequence appropriately.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenry committed Jan 29, 2015
1 parent 423fa1a commit c6f8558
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/main/java/hello/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "user_xyz")
@Table(schema="conf_admin", name = "user_xyz")
public class User {

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="USER_XYZ_SEQ")
private Long id;
@Id
@Column(name = "id", unique = true, nullable = false, insertable=false)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_xyz_seq_generator")
@SequenceGenerator(name = "user_xyz_seq_generator", sequenceName = "conf_admin.user_xyz_seq", allocationSize = 1)
private Long id;

@Column(nullable = false)
private String firstName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<comment>Create schema conf_admin</comment>

<sql>CREATE SCHEMA conf_admin AUTHORIZATION postgres</sql>
<rollback>DROP SCHEMA conf_adming</rollback>
<rollback>DROP SCHEMA conf_admin</rollback>

</changeSet>
<changeSet id="001_create_user_xyz_table" author="Carlus">
Expand Down

0 comments on commit c6f8558

Please sign in to comment.