start hacking
This commit is contained in:
parent
dd326c335c
commit
fb007bea9f
|
@ -63,7 +63,11 @@ public class JpaBindingTest {
|
||||||
long count = em.createQuery("select count(*) from ResRootEntity", Long.class).getSingleResult();
|
long count = em.createQuery("select count(*) from ResRootEntity", Long.class).getSingleResult();
|
||||||
assertEquals(1, count);
|
assertEquals(1, count);
|
||||||
|
|
||||||
em.createQuery("from ResRootEntity", ResRootEntity.class).getResultStream().forEach(e-> assertEquals("hello!", e.getString()));
|
em.createQuery("from ResRootEntity", ResRootEntity.class).getResultStream().forEach(e-> {
|
||||||
|
assertEquals(-1, e.myId);
|
||||||
|
assertEquals(-1, e.myPartitionId);
|
||||||
|
assertEquals("hello!", e.getString());
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
package ca.uhn.fhir.jpa.model.pkspike;
|
package ca.uhn.fhir.jpa.model.pkspike;
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamCoords;
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.FetchType;
|
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
import jakarta.persistence.GenerationType;
|
import jakarta.persistence.GenerationType;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.OneToMany;
|
import jakarta.persistence.OneToMany;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.hibernate.annotations.OptimisticLock;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
@SuppressWarnings("JpaDataSourceORMInspection")
|
||||||
@Entity
|
@Entity
|
||||||
@Table(
|
@Table(
|
||||||
name = "RES_ROOT"
|
name = "RES_ROOT"
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
package ca.uhn.fhir.jpa.test;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.test.config.TestHSearchAddInConfig;
|
|
||||||
import ca.uhn.fhir.jpa.test.config.TestR4Config;
|
|
||||||
import jakarta.inject.Inject;
|
|
||||||
import jakarta.persistence.EntityManagerFactory;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
import org.springframework.transaction.support.TransactionTemplate;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
|
||||||
|
|
||||||
@ContextConfiguration(classes = {
|
|
||||||
TestHSearchAddInConfig.NoFT.class
|
|
||||||
})
|
|
||||||
public class KeyTypeOverrideTest extends BaseJpaR4Test {
|
|
||||||
private static final Logger ourLog = LoggerFactory.getLogger(KeyTypeOverrideTest.class);
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
EntityManagerFactory myEntityManagerFactory;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void empty() {
|
|
||||||
// given
|
|
||||||
|
|
||||||
try (var em = myEntityManagerFactory.createEntityManager()) {
|
|
||||||
newTxTemplate().execute((status)->{
|
|
||||||
em.createQuery("from ResourceTable").getResultStream()
|
|
||||||
.forEach(e->{
|
|
||||||
ourLog.info("found resource");
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// when
|
|
||||||
// then
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -59,12 +59,12 @@ public class LoggingExtension implements BeforeEachCallback, BeforeTestExecution
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeTestExecution(ExtensionContext context) throws Exception {
|
public void beforeTestExecution(ExtensionContext context) {
|
||||||
getLoggerForTestClass(context).info("Starting test case [{}]", getMethodName(context));
|
getLoggerForTestClass(context).info("Starting test case [{}]", getMethodName(context));
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void afterTestExecution(ExtensionContext context) throws Exception {
|
public void afterTestExecution(ExtensionContext context) {
|
||||||
getLoggerForTestClass(context).info("Finished test case [{}]", getMethodName(context));
|
getLoggerForTestClass(context).info("Finished test case [{}]", getMethodName(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue