kuros / random-jpa Goto Github PK
View Code? Open in Web Editor NEWCreate random test data for JPA/Hibernate entities.
License: GNU General Public License v3.0
Create random test data for JPA/Hibernate entities.
License: GNU General Public License v3.0
Let us say we have a link, Link.newLink(Pizza_.cheeseId, Cheese_.id), so Pizza has a foreign key to Cheese.
Now if I say jpaContext.createAndPersist(Entity.of(Pizza.class).with(Pizza_.cheeseId, 123)), it should load existing Cheese Entity with id 123. and not try create another Cheese.
Hello, I am using spring boot, when trying to create a jpaContext I get a exception
Code example:
@PersistenceContext
private EntityManager entityManager;
@Test
public void createAuthorization(){
JPAContext jpaContext = JPAContextFactory.newInstance(Database.POSTGRES, entityManager)
.generate();
}
java.lang.NullPointerException
at com.github.kuros.random.jpa.metamodel.MetaModelProviderImpl.getFieldsByTableName(MetaModelProviderImpl.java:51)
at com.github.kuros.random.jpa.mapper.RelationCreator.(RelationCreator.java:45)
at com.github.kuros.random.jpa.mapper.RelationCreator.from(RelationCreator.java:51)
at com.github.kuros.random.jpa.JPAContextFactory.getCache(JPAContextFactory.java:117)
at com.github.kuros.random.jpa.JPAContextFactory.generate(JPAContextFactory.java:105)
Can you help me please
As the execution plan is executed, Random JPA should log the entities it is trying to create, before it creates them so that, when a sql exception is thrown, then this debug list will show WHERE in the tree it occured, and the factory context can be corrected.
For instance, this is what a typical failure looks like, if I'm reading this correctly, it ran into a constraint violation on the 9th object that it was attempting to create in the tree. But there is no constraint name or Pojo name, and there are only debug logs on success, no debug logs on a per line item basis:
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:727)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:58)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558)
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:490)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:195)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:179)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:214)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125)
at org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84)
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:241)
at com.sun.proxy.$Proxy82.persist(Unknown Source)
at com.github.kuros.random.jpa.persistor.functions.PersistFunction.apply(PersistFunction.java:36)
at com.github.kuros.random.jpa.persistor.functions.FunctionProcessor.findOrSave(FunctionProcessor.java:42)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:98)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:68)
at com.github.kuros.random.jpa.JPAContextImpl.persist(JPAContextImpl.java:74)
at com.cobalt.dap.random.jpa.generator.BaseContext.persist(BaseContext.java:41)
I would have been really happy to use your library however I can't as I am using a different JPA provider than you. I could probably use both in parallel but that wouldn't be convenient.
One of my @Entity
classes has a reference to itself. It would prefer this to be set to null
or a fixed value when generating that entity. I don't really want to edit the entity class itself.
But, I don't see a way to do this. The error comes as soon as I call JpaContextFactory#generate
. I tried assigning a custom attribute and class generator for this class, but it still gives me the error.
I also tried ignoreLink
. See the following example. With this, it fails at the call to jpaContextFactory.generate()
because the link's from
and to
fields are null
. I'm not seeing anything in the code which would look for the @StaticMetamodel
annotation and initialize those?
final com.github.kuros.random.jpa.JPAContextFactory jpaContextFactory =
com.github.kuros.random.jpa.JPAContextFactory.newInstance(Database.ORACLE, entityManager);
final Generator generator = Generator.newInstance();
Link link = Link.newLink(JobTask_.parent, JobTask_.id);
jpaContextFactory.with(Dependencies.newInstance()
.ignoreLink(link));
JPAContext jpaContext = jpaContextFactory.generate();
jpaContext.remove(JobTask.class);
@StaticMetamodel(JobTask.class)
class JobTask_ {
public static volatile SingularAttribute<JobTask, Long> id;
public static volatile SingularAttribute<JobTask, Job> job;
public static volatile SingularAttribute<JobTask, Environment> environment;
public static volatile SingularAttribute<JobTask, JobTask> parent;
}
Here's the relevant part of my @Entity
.
@Entity
@Table(name = "JOB_TASKS")
public class JobTask {
@Id
@GeneratedValue(generator = "triggerAssigned")
@Column(name = "JOB_TASK_ID")
protected Long id;
@ManyToOne
@JoinColumn(name = "job_id", updatable = false, nullable = false)
@NonNull
private Job job;
@Column(name = "ENVIRONMENT_ID")
@Convert(converter = EnvironmentConverter.class)
@NonNull
private Environment environment;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_job_task_id")
private JobTask parent;
}
Cache.set is not working when we want to override reference table column value
If both eclipselink and hibernate-validator exist on classpath, then com.github.kuros.random.jpa.metamodel.AttributeProviderFactory will choose HibernateProvider because hibernate-validator contains org.hibernate.Version class.
I would suggest to reverse checking logic - check for eclipselink first.
Scenario:
@Entity
@Table(name = "entity")
public class Entity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "name")
private Long id;
@OneToOne
@JoinColumn(name = "id")
private ReferencedEntity refEntity;
...
}
In this type of entity, Persistence was failing giving detached/constaint violation error intermittently
I want a mechanism to fetch all the items to be deleted before remove method
If a trigger a inserting new rows into a table, I need a mechanism to load these entities
For example I have this tables:
Relations:
1 Invoice -> N InvoiceDetails
1 Invoice -> N InvoiceTrack
I want generate 1 Invoice and 2 InvoiceDetails and 2 InvoiceTrack in the same plan. I understood that it's a tree structure, so I don't know if my intent is posible.
I expected something like this:
└── *ROOT*
└── (h=1) Invoice|0
├── (h=0) InvoiceDetails|0
├── (h=0) InvoiceDetails|1
├── (h=0) InvoiceTrack|2
├── (h=0) InvoiceTrack|3
My Links:
links.add(Link.newLink(InvoiceDetails_.id, Invoice_.details));
links.add(Link.newLink(InvoiceTrack_.id, Invoice_.track));
My Creation Plan:
final JPAContext jpaContext = JPAContextFactory
.newInstance(Database.POSTGRES, entityManager)
.with(dependencies)
.generate();
final CreationPlan creationPlan = jpaContext.create(
Entity.of(Invoice.class)
Entity.of(InvoiceDetails.class, 2),
Entity.of(InvoiceTrack.class, 2)
);
Output:
└── *ROOT*
└── (h=1) Invoice|0
├── (h=0) InvoiceDetails|0
│ ├── (h=0) InvoiceTrack|0
│ └── (h=0) InvoiceTrack|1
└── (h=0) InvoiceDetails|1
├── (h=0) InvoiceTrack|2
└── (h=0) InvoiceTrack|3
Currently IdClass is not supported
package com.xqdd.hobby.entity;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
@MappedSuperclass
@Data
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Long id;
@CreatedDate
protected long createTime;
@LastModifiedDate
private long updateTime;
}
package com.xqdd.hobby.entity.user;
import com.xqdd.hobby.entity.BaseEntity;
import lombok.Data;
import javax.persistence.Entity;
@Entity
@Data
public class User extends BaseEntity {
private String wxOpenId;
private String googleId;
}
package com.xqdd.hobby.entity.other;
import com.xqdd.hobby.entity.BaseEntity;
import com.xqdd.hobby.entity.user.User;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
@Data
@Entity
public class Resource extends BaseEntity {
@Column
private String name;
private String url;
@ManyToOne
private User uploader;
}
package com.xqdd.hobby;
import com.github.kuros.random.jpa.Database;
import com.github.kuros.random.jpa.JPAContext;
import com.github.kuros.random.jpa.JPAContextFactory;
import com.github.kuros.random.jpa.types.Entity;
import com.xqdd.hobby.entity.other.Resource;
import com.xqdd.hobby.entity.user.User;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
import javax.persistence.EntityManager;
@SpringBootTest
public class MarkdownTest extends AbstractTransactionalJUnit4SpringContextTests {
@Autowired
private EntityManager entitymanager;
@Test
public void test() {
final JPAContext jpaContext = JPAContextFactory.newInstance(Database.MY_SQL, entitymanager).generate();
var resourceEntity = Entity.of(Resource.class).createAfter(User.class);
var resultMap = jpaContext.createAndPersist(resourceEntity);
}
}
com.github.kuros.random.jpa.exception.RandomJPAException: unable to save: class com.xqdd.hobby.entity.other.Resource
at com.github.kuros.random.jpa.persistor.functions.FunctionProcessor.findOrSave(FunctionProcessor.java:49)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:98)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:106)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:68)
at com.github.kuros.random.jpa.JPAContextImpl.persist(JPAContextImpl.java:76)
at com.github.kuros.random.jpa.JPAContextImpl.createAndPersist(JPAContextImpl.java:119)
at com.github.kuros.random.jpa.JPAContextImpl.createAndPersist(JPAContextImpl.java:85)
at com.xqdd.hobby.MarkdownTest.test(MarkdownTest.java:28)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.xqdd.hobby.entity.other.Resource.uploader -> com.xqdd.hobby.entity.user.User
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:151)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1459)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1439)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:308)
at com.sun.proxy.$Proxy113.flush(Unknown Source)
at com.github.kuros.random.jpa.persistor.functions.PersistFunction.apply(PersistFunction.java:37)
at com.github.kuros.random.jpa.persistor.functions.FunctionProcessor.findOrSave(FunctionProcessor.java:42)
... 39 more
Caused by: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.xqdd.hobby.entity.other.Resource.uploader -> com.xqdd.hobby.entity.user.User
at org.hibernate.engine.spi.CascadingActions$8.noCascade(CascadingActions.java:380)
at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:159)
at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:150)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:83)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1453)
... 48 more
randomFactory.generateRandom(Instant.class)
returns null
by default, custom generator needs to be provided.
In case of microsoft sql server, -1 is set as the character length for nvarchar for large data is set to 2gb
@entity
@table(name = "A")
public class A {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column
private String name;
private String address;
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public long getId() {
return id;
}
public void setId(final long id) {
this.id = id;
}
@Column
public String getAddress() {
return address;
}
public void setAddress(final String address) {
this.address = address;
}
}
Appreciate this project !!!
Would love to see H2 support in here.
Not able to create softlink variables of different types, eg Long vs Integer
com.github.kuros.random.jpa.exception.RandomJPAException: java.lang.NullPointerException
at com.github.kuros.random.jpa.persistor.functions.FindById.apply(FindById.java:66)
at com.github.kuros.random.jpa.persistor.functions.FunctionProcessor.findOrSave(FunctionProcessor.java:42)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:98)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:84)
at com.github.kuros.random.jpa.persistor.EntityPersistorImpl.persist(EntityPersistorImpl.java:68)
at com.github.kuros.random.jpa.JPAContextImpl.persist(JPAContextImpl.java:74)
at com.adharbour.da.persistence.generator.BaseContext.persist(BaseContext.java:33)
at com.adharbour.da.persistence.generator.BaseContext.createAndPersist(BaseContext.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy85.createAndPersist(Unknown Source)
at com.adharbour.da.channel.repository.CustomerNeedsUpdateRepositoryTest.name(CustomerNeedsUpdateRepositoryTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:515)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:113)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:134)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:128)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:109)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:128)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:109)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:128)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:109)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:49)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:47)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:184)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:152)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:166)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:145)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:92)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.NullPointerException
at java.lang.Class.searchFields(Class.java:2956)
at java.lang.Class.getDeclaredField(Class.java:2068)
at com.github.kuros.random.jpa.util.Util.getField(Util.java:113)
at com.github.kuros.random.jpa.persistor.functions.FindById.apply(FindById.java:57)
... 59 more
Caused by: java.sql.BatchUpdateException: ORA-01438: value larger than specified precision allowed for this column
I want to detect cyclic dependency for the relationship created.
Random-JPA throws cyclic dependency when tables are generated with self foreign key on H2 db in test scenario.
README.md
's creating-plan and the Wiki section about plans are inconsistent with the latest version of the API. The method JpaContextImpl#create(Plan) is private and not exposed in JpaContext
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.