如何使用hibernate在特定模式中生成序列?

时间:2015-08-04 15:24:12

标签: java hibernate jpa

我想使用sequence自动生成hibernate

    @Entity
    @Table(name = "my_entity", schema = "test")
    public static class MyEntity {    
        private static final String SEQUENCE = "my_seq";

        @Id
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQUENCE)
        @SequenceGenerator(name = SEQUENCE, sequenceName = SEQUENCE, schema = "test")
        private Long id;
     }

结果:序列在架构public中生成。为什么呢?

0 个答案:

没有答案