File tree Expand file tree Collapse file tree 14 files changed +25
-29
lines changed
src/test/java/com/jeeconf/hibernate/performancetuning Expand file tree Collapse file tree 14 files changed +25
-29
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ public class BatchFetchingTest extends BaseTest {
1717 @ SuppressWarnings ("unchecked" )
1818 @ Test
1919 public void batchFetching () {
20- List <Client > clients = session .createQuery ("select c from " +
21- "com.jeeconf.hibernate.performancetuning.batchfetching.entity.Client c " +
22- "where c.age >= :age" )
20+ List <Client > clients = session .createQuery ("select c from BatchableFetchedClientEntity c where c.age >= :age" )
2321 .setParameter ("age" , 18 )
2422 .list ();
2523 clients .forEach (c -> c .getAccounts ().size ());
Original file line number Diff line number Diff line change 1111/**
1212 * Created by Igor Dmitriev / Mikalai Alimenkou on 4/29/16
1313 */
14- @ Entity
14+ @ Entity ( name = "BatchableFetchedClientEntity" )
1515@ Getter
1616@ Setter
1717@ BatchSize (size = 5 )
18+ @ Table (name = "Client" )
1819public class Client {
1920 @ Id
2021 @ GeneratedValue (strategy = GenerationType .SEQUENCE )
Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ public void batchInsert() {
4545 @ Commit
4646 @ Test
4747 public void batchUpdate () {
48- Query query = session .createQuery ("select c from " +
49- "com.jeeconf.hibernate.performancetuning.batchprocessing.entity.Client c" );
48+ Query query = session .createQuery ("select c from BatchableClientEntity c" );
5049 ScrollableResults scroll = query .setFetchSize (50 )
5150 .setCacheMode (CacheMode .IGNORE )
5251 .scroll (ScrollMode .FORWARD_ONLY );
@@ -70,8 +69,7 @@ public void batchUpdate() {
7069 @ Commit
7170 @ Test
7271 public void batchCascadeDelete () {
73- List <Client > clients = session .createQuery ("select c from " +
74- "com.jeeconf.hibernate.performancetuning.batchprocessing.entity.Client c" )
72+ List <Client > clients = session .createQuery ("select c from BatchableClientEntity c" )
7573 .list ();
7674 clients .forEach (session ::delete );
7775 flushAndClear ();
Original file line number Diff line number Diff line change 1010/**
1111 * Created by Igor Dmitriev / Mikalai Alimenkou on 4/29/16
1212 */
13- @ Entity
13+ @ Entity ( name = "BatchableClientEntity" )
1414@ Getter
1515@ Setter
16+ @ Table (name = "Client" )
1617public class Client {
1718 @ Id
1819 @ GeneratedValue (strategy = GenerationType .SEQUENCE )
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public void queryCache() {
3838
3939 @ Test
4040 public void queryCacheInConjunctionWithSecondLevel () {
41- String query = "select c from com.jeeconf.hibernate.performancetuning.cache.entity.Client c" ;
41+ String query = "select c from CachableFromSecondLevelCacheClient c" ;
4242 executeCacheableQuery (query );
4343 session .clear ();
4444 executeCacheableQuery (query );
Original file line number Diff line number Diff line change 1111/**
1212 * Created by Igor Dmitriev / Mikalai Alimenkou on 4/29/16
1313 */
14- @ Entity
14+ @ Entity ( name = "CachableFromSecondLevelCacheClient" )
1515@ Getter
1616@ Setter
17+ @ Table (name = "Client" )
1718public class Client {
1819 @ Id
1920 @ GeneratedValue (strategy = GenerationType .SEQUENCE )
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public void dirtyCheckingDisableForQuery() {
4040 //session.setReadOnly(Client.class, true);
4141 // for queries it is also possible
4242 /*session.createQuery("select c " +
43- "from com.jeeconf.hibernate.performancetuning.dirtychecking.entity.Client c")
43+ "from DirtyCheckableClient c")
4444 .setReadOnly(true).list();*/
4545
4646 AssertSqlCount .assertSelectCount (1 );
@@ -50,8 +50,7 @@ public void dirtyCheckingDisableForQuery() {
5050 @ Commit
5151 public void statelessSession () {
5252 StatelessSession statelessSession = getSessionFactory ().openStatelessSession ();
53- ScrollableResults scroll = statelessSession .createQuery ("select c from " +
54- "com.jeeconf.hibernate.performancetuning.dirtychecking.entity.Client c" )
53+ ScrollableResults scroll = statelessSession .createQuery ("select c from DirtyCheckableClient c" )
5554 .scroll (ScrollMode .FORWARD_ONLY );
5655 int count = 0 ;
5756 while (scroll .next ()) {
Original file line number Diff line number Diff line change 1010/**
1111 * Created by Igor Dmitriev / Mikalai Alimenkou on 4/29/16
1212 */
13- @ Entity
13+ @ Entity ( name = "DirtyCheckableClient" )
1414@ Getter
1515@ Setter
16+ @ Table (name = "Client" )
1617public class Client {
1718 @ Id
1819 @ GeneratedValue (strategy = GenerationType .SEQUENCE )
Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ public void clientFetchAccounts() {
2626 }
2727
2828 private TypedQuery <Client > findAdultClientsQuery () {
29- return em .createQuery ("select c from com.jeeconf.hibernate.performancetuning.entitygraph.entity.Client c " +
30- "where c.age >= :age" , Client .class )
29+ return em .createQuery ("select c from EntityGraphClient c where c.age >= :age" , Client .class )
3130 .setParameter ("age" , 18 );
3231 }
3332}
Original file line number Diff line number Diff line change 1010/**
1111 * Created by Igor Dmitriev / Mikalai Alimenkou on 4/29/16
1212 */
13- @ Entity
13+ @ Entity ( name = "EntityGraphClient" )
1414@ Getter
1515@ Setter
1616@ NamedEntityGraphs ({
1717 @ NamedEntityGraph (name = Client .ACCOUNTS_GRAPH ,
1818 attributeNodes = @ NamedAttributeNode ("accounts" ))
1919})
20+ @ Table (name = "Client" )
2021public class Client {
21- public static final String ACCOUNTS_GRAPH = "Client [accounts]" ;
22+ public static final String ACCOUNTS_GRAPH = "EntityGraphClient [accounts]" ;
2223
2324 @ Id
2425 @ GeneratedValue (strategy = GenerationType .SEQUENCE )
You can’t perform that action at this time.
0 commit comments