I have two different components that use two different DB's but the entity is on both DB's and I want it to have the same ID's always.
So basically when the ID is null I want it to be auto generated, if it's not null use the ID.
I'm using hibernate.
@Id
@Column(name = COLUMN_ID, unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
}
Any suggestions?