Internal HSQL database complains about privileges

前端 未结 8 1890
时光取名叫无心
时光取名叫无心 2020-12-10 03:58

I\'m setting up a standalone Java service with an in-process, in-memory HSQL database.

Persistence.xml



        
相关标签:
8条回答
  • 2020-12-10 04:36

    I ran into a similar problem, but in my case the problem occurred because of column definitions. I used MySQL definitions in this way:

    @Id
    @GeneratedValue
    @Column(columnDefinition = "INT(11)")
    private long id;
    

    This seems to not be supported by HSQL, and I changed the definition to this:

    @Id
    @GeneratedValue
    @Column(columnDefinition = "INTEGER")
    private long id;
    

    And then the tests worked again.

    0 讨论(0)
  • 2020-12-10 04:37

    When I had this error, I realised that I was using the wrong provider class in persistence.xml

    For Hibernate it should be

    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    

    And for EclipseLink it should be

    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    

    You should also note that different names are used in persistence.xml and when creating Persistence.createEntityManagerFactory("name")

    0 讨论(0)
提交回复
热议问题