GithubHelp home page GithubHelp logo

kuros / random-jpa Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 4.0 795 KB

Create random test data for JPA/Hibernate entities.

License: GNU General Public License v3.0

Java 100.00%
randomizer jpa testing data-generator hibernate-test hibernate entity test-data test-data-generator

random-jpa's People

Contributors

caodangtinh avatar kuros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

random-jpa's Issues

Primary table should be loaded if foreign key Id provided

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.

I can't generate the JPAContext

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

Add Debugging to the creation plan so failures can be tracked down.

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)

No way to resolve "Cyclic dependency found for class"?

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;
}

Incorrect provider is set when using hibernate-validator

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.

Entity was not getting persisted with detached error if reference column maps to same id

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

Create data of entities at the same level

For example I have this tables:

  • Invoices (Parent)
  • InvoiceDetails (Child)
  • InvoiceTrack (Child)

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

can't auto detect relationship

BaseEntity

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;
}

User

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;

}

Resource

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;
}

unit test

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);
    }
}

errors


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

Random-JPA throwing JPA not supported error after adding entity

@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;
}

}

Getting Null pointer when using Composite Key

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.