Property 'deleteTs' not found for all entities deriving from standardtenantentity in integration test

Im not immediately convinced the cause in in the multitenancy plugin.

I debugged into the code and i can only see that propertyByName is equal to ownPropertyByName, holding only the local members.

package test;

import org.junit.ClassRule;
import org.junit.Test;

import javax.persistence.EntityManager;

public class Minimumfailingtest {
        @ClassRule
        public static TestContainer cont = TestContainer.Common.INSTANCE;

        @Test
        public void test() {
            cont.persistence().createTransaction();
            EntityManager em = cont.persistence().getEntityManager().getDelegate();
        }
}


14:13:56.791 ERROR eclipselink.ejb - 

Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: java.lang.IllegalArgumentException: Property 'deleteTs' not found in hysoptpmc$PumpField
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: java.lang.IllegalArgumentException: Property 'deleteTs' not found in hysoptpmc$PumpField
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:446)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:378)
	at com.haulmont.cuba.core.sys.TransactionImpl.<init>(TransactionImpl.java:63)
	at com.haulmont.cuba.core.sys.TransactionsImpl.create(TransactionsImpl.java:55)
	at com.haulmont.cuba.core.sys.PersistenceImpl.createTransaction(PersistenceImpl.java:136)
	at com.hysopt.pmc.core.SampleIntegrationTest.testLoadUser(SampleIntegrationTest.java:40)
	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.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.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	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.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:117)
	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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)
Caused by: javax.persistence.PersistenceException: java.lang.IllegalArgumentException: Property 'deleteTs' not found in hysoptpmc$PumpField
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:852)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:219)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:327)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:350)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:313)
	at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:464)
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:390)
	... 56 more
Caused by: java.lang.IllegalArgumentException: Property 'deleteTs' not found in hysoptpmc$PumpField
	at com.haulmont.chile.core.model.impl.MetaClassImpl.getPropertyNN(MetaClassImpl.java:107)
	at com.haulmont.cuba.core.sys.persistence.EclipseLinkSessionEventListener.preLogin(EclipseLinkSessionEventListener.java:92)
	at org.eclipse.persistence.sessions.SessionEventManager.preLogin(SessionEventManager.java:622)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:853)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:829)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:258)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:767)
	... 62 more

Hi,

Probably something is wrong with the hysoptpmc$PumpField entity declaration.
Can you share the code of this entity and its ancestors?

package com.hysopt.pmc.entity.part.pump;

import com.haulmont.addon.sdbmt.entity.StandardTenantEntity;
import com.haulmont.chile.core.annotations.Composition;
import com.haulmont.cuba.core.entity.annotation.OnDelete;
import com.haulmont.cuba.core.global.DeletePolicy;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Table(name = "HYSOPTPMC_PUMP_CURVE")
@Entity(name = "hysoptpmc$PumpCurve")
public class PumpCurve extends StandardTenantEntity {
    @Column(name = "NAME")
    protected String name;

    @Column(name = "SPEED")
    protected Double speed;

    @Column(name = "OPERATION_TYPE")
    protected String operationType;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PUMP_FIELD_ID")
    protected PumpField pumpField;

    @Composition
    @OnDelete(DeletePolicy.CASCADE)
    @OneToMany(mappedBy = "pumpCurve")
    protected List<PumpCurvePoint> curvePoints = new ArrayList<>();

    public PumpOperationType getOperationType() {
        return operationType == null ? null : PumpOperationType.fromId(operationType);
    }

    public void setOperationType(PumpOperationType operationType) {
        this.operationType = operationType == null ? null : operationType.getId();
    }

    public Double getSpeed() {
        return speed;
    }

    public void setSpeed(Double speed) {
        this.speed = speed;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<PumpCurvePoint> getCurvePoints() {
        return curvePoints;
    }

    public void setCurvePoints(List<PumpCurvePoint> curvePoints) {
        this.curvePoints = curvePoints;
    }

    public void addCurvePoint(PumpCurvePoint curvePoint) {
        curvePoint.setPumpCurve(this);
        curvePoints.add(curvePoint);
    }

    public PumpField getPumpField() {
        return pumpField;
    }

    public void setPumpField(PumpField pumpField) {
        this.pumpField = pumpField;
    }
}

using the multittenancy plugin.

I don’t see anything wrong immediately.

I created a concise example and made a new issue at