eclipselink

Alter sequence in H2

倖福魔咒の 提交于 2020-05-13 05:27:08
问题 I'm using Postgres database in production and H2 for tests. I want to create a new sequence for an existing table - so in Liquibase I wrote this: <changeSet id="Add sequence for BOOKS" author="library"> <createSequence sequenceName="BOOKS_SEQ" incrementBy="500" startValue="1"/> </changeSet> My Entity looks like this: @Entity @Table(name = "BOOKS") @SequenceGenerator(name = "BOOKS_SEQ", allocationSize = 500) public class Book { @Id @GeneratedValue(generator = "BOOKS_SEQ", strategy =

Alter sequence in H2

邮差的信 提交于 2020-05-13 05:25:58
问题 I'm using Postgres database in production and H2 for tests. I want to create a new sequence for an existing table - so in Liquibase I wrote this: <changeSet id="Add sequence for BOOKS" author="library"> <createSequence sequenceName="BOOKS_SEQ" incrementBy="500" startValue="1"/> </changeSet> My Entity looks like this: @Entity @Table(name = "BOOKS") @SequenceGenerator(name = "BOOKS_SEQ", allocationSize = 500) public class Book { @Id @GeneratedValue(generator = "BOOKS_SEQ", strategy =

Could not bind properties

老子叫甜甜 提交于 2020-04-12 11:34:28
问题 I've updated Spring Boot from version 1.5.6 to 2.0.0 and a lot of problems have started. One is the problem given in the subject. I have a class with properties @Data @ConfigurationProperties("eclipseLink") public class EclipseLinkProperties { ... } which I use in configuration @Configuration @EnableConfigurationProperties(EclipseLinkProperties.class) public class WebDatasourceConfig { ... } during compilation, he throws me away 2018-03-18 18:44:58.560 INFO 3528 --- [ main] trationDelegate

Could not bind properties

浪子不回头ぞ 提交于 2020-04-12 11:32:53
问题 I've updated Spring Boot from version 1.5.6 to 2.0.0 and a lot of problems have started. One is the problem given in the subject. I have a class with properties @Data @ConfigurationProperties("eclipseLink") public class EclipseLinkProperties { ... } which I use in configuration @Configuration @EnableConfigurationProperties(EclipseLinkProperties.class) public class WebDatasourceConfig { ... } during compilation, he throws me away 2018-03-18 18:44:58.560 INFO 3528 --- [ main] trationDelegate

Could not bind properties

*爱你&永不变心* 提交于 2020-04-12 11:32:06
问题 I've updated Spring Boot from version 1.5.6 to 2.0.0 and a lot of problems have started. One is the problem given in the subject. I have a class with properties @Data @ConfigurationProperties("eclipseLink") public class EclipseLinkProperties { ... } which I use in configuration @Configuration @EnableConfigurationProperties(EclipseLinkProperties.class) public class WebDatasourceConfig { ... } during compilation, he throws me away 2018-03-18 18:44:58.560 INFO 3528 --- [ main] trationDelegate

JPA cascade all causing integrity constraint

五迷三道 提交于 2020-03-04 05:28:45
问题 I have three tables Employee, Boss, and Address. Employee and Boss in this case share the same Address. When I call EntityManager.remove on Employee I get an Integrity Constraint exception because it tries to delete the Address which it can't because Boss still needs it. If no one is using the Address though I would want it to be removed. What should my annotations look like so that I can delete orphans from Address but avoid the integrity constraint? Exception = Internal Exception: java.sql

EclipseLink JPA - location of persistence.xml

不羁岁月 提交于 2020-02-26 12:38:26
问题 I am using JPA for a java class and having trouble putting the persistence XML file where it should be. The IDE i am using is Eclipse Helios. Eclipselink jar files are downloaded and added to my JRE System Library and all. I wrote up the persistence.xml with the tag after getting the following error : Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named customers Provider tag: <provider>org.eclipse.persistence.jpa

@SpringBootTest interferes with EclipseLink dynamic weaving

﹥>﹥吖頭↗ 提交于 2020-02-24 11:54:30
问题 My company is developing a web application using Spring Boot, Spring MVC, JPA with EclipseLink and dynamic weaving. My task is to prepare implementation of UI and integration tests spinning up the application using JUnit and @SpringBootTest and interacting with it using Selenium. As stated at Spring Boot Testing Features, Tests using the @SpringBootApplication annotation can make use of the @MockBean annotation to define Mockito mocks for beans within the ApplicationContext. This is achieved

Ignoring DTDs when unmarshalling with EclipseLink MOXy

半世苍凉 提交于 2020-02-24 03:35:52
问题 When trying to unmarshall some XML into a POJO using EclipseLink MOXy I'm getting a FileNotFoundException where it's looking for the document's DTD as a relative path. Exception in thread "main" org.springframework.oxm.UnmarshallingFailureException: JAXB unmarshalling exception; nested exception is javax.xml.bind.UnmarshalException - with linked exception: [java.io.FileNotFoundException: C:\Users\deejay\Documents\workspace-sts-3.0.0.RELEASE\moxy-test\ieee_idams_exchange.dtd (The system cannot

JPA: Circular relations: diff between EclipseLink and Hiberante

Deadly 提交于 2020-02-23 06:31:34
问题 We have an entity Role which could be either users or groups. In the groups we have set permissions. Therefore a user belongs to a group. Additionally groups can belong to other groups, i.e. one could make a hierarchy of permissions. The idea is to store the relations from e.g. user -> group into a separate db table role_ref . @Table(name = "role__parent") @IdClass(RoleAssociationKey.class) @Data public class RoleAssociation implements Serializable { @Id @JoinColumn(name = "has_parent_role_id