Hibernate/JPA Sorting Repo Compiled in Eclipse
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
|
||||
<persistence-unit name="punit" >
|
||||
<class>org.baeldung.persistence.model.Foo</class>
|
||||
<class>org.baeldung.persistence.model.Bar</class>
|
||||
<properties>
|
||||
<property name="javax.persistence.jdbc.user" value="root"/>
|
||||
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/HIBERTEST"/>
|
||||
<property name="javax.persistence.ddl-generation" value="drop-and-create-tables"/>
|
||||
<property name="javax.persistence.logging.level" value="INFO"/>
|
||||
<property name = "hibernate.show_sql" value = "true" />
|
||||
</properties>
|
||||
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
+9
-4
@@ -1,7 +1,9 @@
|
||||
package org.baeldung.persistence.service;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.persistence.EntityTransaction;
|
||||
@@ -11,11 +13,13 @@ import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import org.baeldung.persistence.model.Bar;
|
||||
import org.baeldung.persistence.model.Foo;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import com.cc.jpa.example.Foo;
|
||||
import com.cc.jpa.example.Bar;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
public class FooServiceSortingTests {
|
||||
private static EntityManager entityManager;
|
||||
@@ -162,4 +166,5 @@ public class FooServiceSortingTests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user