multiple database support for same JPA classs

后端 未结 2 1522
迷失自我
迷失自我 2020-12-12 03:59

We using MYSQL and Hibernate for our project.

JPA is used to persist object in DB.

We have Multiple class with similar code

@Entity
@Table(n         


        
2条回答
  •  时光取名叫无心
    2020-12-12 04:18

    The AUTO strategy should work on Oracle as well. The difference with MySQL is that it will use a sequence instead of relying on an auto_increment ID.

    You can even control the sequence name per entity if desired: see Hibernate sequence on oracle, @GeneratedValue(strategy = GenerationType.AUTO).

提交回复
热议问题