You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <hu...@op...> - 2012-06-29 17:04:13
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/69/changes> |
From: <gca...@us...> - 2012-06-29 16:59:55
|
Revision: 4086 http://openutils.svn.sourceforge.net/openutils/?rev=4086&view=rev Author: gcatania Date: 2012-06-29 16:59:49 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Merged revisions 4084-4085 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4084 | gcatania | 2012-06-29 18:51:34 +0200 (Fri, 29 Jun 2012) | 1 line avoid legacy whenever possible ........ r4085 | gcatania | 2012-06-29 18:55:25 +0200 (Fri, 29 Jun 2012) | 1 line fix filter metadata support not working for empty filter metadata ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4084&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4085&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Property Changed: ---------------- branches/openutils-bshd5-backport/ branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/openutils-bshd5:1-4040,4042-4056,4058-4082 + /trunk/openutils-bshd5:1-4040,4042-4056,4058-4085 Modified: svn:mergeinfo - /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078*,4080*,4082* + /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078*,4080*,4082*,4084-4085* Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078,4080,4082 + /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078,4080,4082,4084-4085 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078,4080,4082 + /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078,4080,4082,4084-4085 Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:55:25 UTC (rev 4085) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:59:49 UTC (rev 4086) @@ -1,4 +1,4 @@ -/** + /** * * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) * @@ -38,6 +38,7 @@ import org.aopalliance.aop.AspectException; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.Hibernate; @@ -484,8 +485,16 @@ public List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata, int maxResults, int page, List<Criterion> criteria, Order... orders) { - return (List<T>) getHibernateTemplate().execute( - new LegacySupportCallback<T>(filter, maxResults, page, metadata, criteria, orders)); + HibernateCallback callback; + if (MapUtils.isEmpty(metadata) && CollectionUtils.isEmpty(criteria)) + { + callback = new ExampleTreeCallback(new ExampleTree(filter), maxResults, page, orders); + } + else + { + callback = new LegacySupportCallback(filter, maxResults, page, metadata, criteria, orders); + } + return (List<T>) getHibernateTemplate().execute(callback); } /** @@ -507,8 +516,23 @@ public List<?> findFilteredProperties(T filter, Order[] orders, Map<String, FilterMetadata> metadata, int maxResults, int page, List<Criterion> criteria, List<String> properties) { - return (List<Object>) getHibernateTemplate().execute( - new LegacySupportPropertiesCallback(filter, maxResults, page, metadata, criteria, properties, orders)); + HibernateCallback callback; + if (MapUtils.isEmpty(metadata) && CollectionUtils.isEmpty(criteria)) + { + callback = new ExampleTreePropertiesCallback(new ExampleTree(filter), maxResults, page, properties, orders); + } + else + { + callback = new LegacySupportPropertiesCallback( + filter, + maxResults, + page, + metadata, + criteria, + properties, + orders); + } + return (List<Object>) getHibernateTemplate().execute(callback); } /** Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:55:25 UTC (rev 4085) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:59:49 UTC (rev 4086) @@ -27,11 +27,11 @@ import it.openutils.hibernate.selectors.ExcludeBackrefPropertySelector; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.apache.commons.collections.MapUtils; import org.hibernate.Criteria; import org.hibernate.EntityMode; import org.hibernate.Hibernate; @@ -65,7 +65,7 @@ throw new NullPointerException("Null entity."); } this.entity = entity; - this.filterMetadata = filterMetadata; + this.filterMetadata = filterMetadata != null ? filterMetadata : Collections.<String, FilterMetadata> emptyMap(); } /** @@ -106,10 +106,7 @@ public Criteria walk(Criteria rootCriteria, Object rootEntity) { - if (MapUtils.isNotEmpty(filterMetadata)) - { - createSubExamples(rootCriteria, rootEntity, new String[0]); - } + createSubExamples(rootCriteria, rootEntity, new String[0]); return rootCriteria; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:55:36
|
Revision: 4085 http://openutils.svn.sourceforge.net/openutils/?rev=4085&view=rev Author: gcatania Date: 2012-06-29 16:55:25 +0000 (Fri, 29 Jun 2012) Log Message: ----------- fix filter metadata support not working for empty filter metadata Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:51:34 UTC (rev 4084) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:55:25 UTC (rev 4085) @@ -27,11 +27,11 @@ import it.openutils.hibernate.selectors.ExcludeBackrefPropertySelector; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.apache.commons.collections.MapUtils; import org.hibernate.Criteria; import org.hibernate.EntityMode; import org.hibernate.Hibernate; @@ -65,7 +65,7 @@ throw new NullPointerException("Null entity."); } this.entity = entity; - this.filterMetadata = filterMetadata; + this.filterMetadata = filterMetadata != null ? filterMetadata : Collections.<String, FilterMetadata> emptyMap(); } /** @@ -106,10 +106,7 @@ public Criteria walk(Criteria rootCriteria, Object rootEntity) { - if (MapUtils.isNotEmpty(filterMetadata)) - { - createSubExamples(rootCriteria, rootEntity, new String[0]); - } + createSubExamples(rootCriteria, rootEntity, new String[0]); return rootCriteria; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:51:40
|
Revision: 4084 http://openutils.svn.sourceforge.net/openutils/?rev=4084&view=rev Author: gcatania Date: 2012-06-29 16:51:34 +0000 (Fri, 29 Jun 2012) Log Message: ----------- avoid legacy whenever possible Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:34:55 UTC (rev 4083) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:51:34 UTC (rev 4084) @@ -38,6 +38,7 @@ import org.aopalliance.aop.AspectException; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.Hibernate; @@ -482,8 +483,16 @@ public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, Order... orders) { - return getHibernateTemplate().execute( - new LegacySupportCallback<T>(filter, maxResults, page, metadata, criteria, orders)); + HibernateCallback<List<T>> callback; + if (MapUtils.isEmpty(metadata) && CollectionUtils.isEmpty(criteria)) + { + callback = new ExampleTreeCallback<T>(new ExampleTree(filter), maxResults, page, orders); + } + else + { + callback = new LegacySupportCallback<T>(filter, maxResults, page, metadata, criteria, orders); + } + return getHibernateTemplate().execute(callback); } /** @@ -506,8 +515,23 @@ Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties) { - return getHibernateTemplate().execute( - new LegacySupportPropertiesCallback(filter, maxResults, page, metadata, criteria, properties, orders)); + HibernateCallback<List<Object>> callback; + if (MapUtils.isEmpty(metadata) && CollectionUtils.isEmpty(criteria)) + { + callback = new ExampleTreePropertiesCallback(new ExampleTree(filter), maxResults, page, properties, orders); + } + else + { + callback = new LegacySupportPropertiesCallback( + filter, + maxResults, + page, + metadata, + criteria, + properties, + orders); + } + return getHibernateTemplate().execute(callback); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:35:01
|
Revision: 4083 http://openutils.svn.sourceforge.net/openutils/?rev=4083&view=rev Author: gcatania Date: 2012-06-29 16:34:55 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Merged revisions 4082 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4082 | gcatania | 2012-06-29 18:32:50 +0200 (Fri, 29 Jun 2012) | 1 line fix unit tests after backwards compatibility fix ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4082&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java Property Changed: ---------------- branches/openutils-bshd5-backport/ branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/openutils-bshd5:1-4040,4042-4056,4058-4080 + /trunk/openutils-bshd5:1-4040,4042-4056,4058-4082 Modified: svn:mergeinfo - /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078*,4080* + /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078*,4080*,4082* Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078,4080 + /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078,4080,4082 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078,4080 + /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078,4080,4082 Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java 2012-06-29 16:32:50 UTC (rev 4082) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java 2012-06-29 16:34:55 UTC (rev 4083) @@ -101,7 +101,9 @@ criteria.add(Restrictions.lt(propertyName, 22d)); } }; - List<Sticker> found = stickerDAO.findFiltered(new Sticker(), Collections.singletonMap("height", fm)); + Sticker stickerFilter = new Sticker(); + stickerFilter.setHeight(12d); // unused but must be not null for backwards compatibility + List<Sticker> found = stickerDAO.findFiltered(stickerFilter, Collections.singletonMap("height", fm)); Assert.assertEquals(found.size(), 1); Assert.assertEquals(found.get(0), st1); } @@ -143,7 +145,9 @@ } }; Car filter = new Car(); - filter.setStickers(Collections.singletonList(new Sticker())); + Sticker stickerFilter = new Sticker(); + stickerFilter.setHeight(12d); // unused but must be not null for backwards compatibility + filter.setStickers(Collections.singletonList(stickerFilter)); List<Car> found = carDAO.findFiltered(filter, Collections.singletonMap("stickers.height", fm)); Assert.assertEquals(found.size(), 1); Car actual = found.get(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:32:56
|
Revision: 4082 http://openutils.svn.sourceforge.net/openutils/?rev=4082&view=rev Author: gcatania Date: 2012-06-29 16:32:50 +0000 (Fri, 29 Jun 2012) Log Message: ----------- fix unit tests after backwards compatibility fix Modified Paths: -------------- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java Modified: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java 2012-06-29 16:29:10 UTC (rev 4081) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java 2012-06-29 16:32:50 UTC (rev 4082) @@ -101,7 +101,9 @@ criteria.add(Restrictions.lt(propertyName, 22d)); } }; - List<Sticker> found = stickerDAO.findFiltered(new Sticker(), Collections.singletonMap("height", fm)); + Sticker stickerFilter = new Sticker(); + stickerFilter.setHeight(12d); // unused but must be not null for backwards compatibility + List<Sticker> found = stickerDAO.findFiltered(stickerFilter, Collections.singletonMap("height", fm)); Assert.assertEquals(found.size(), 1); Assert.assertEquals(found.get(0), st1); } @@ -143,7 +145,9 @@ } }; Car filter = new Car(); - filter.setStickers(Collections.singletonList(new Sticker())); + Sticker stickerFilter = new Sticker(); + stickerFilter.setHeight(12d); // unused but must be not null for backwards compatibility + filter.setStickers(Collections.singletonList(stickerFilter)); List<Car> found = carDAO.findFiltered(filter, Collections.singletonMap("stickers.height", fm)); Assert.assertEquals(found.size(), 1); Car actual = found.get(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:29:16
|
Revision: 4081 http://openutils.svn.sourceforge.net/openutils/?rev=4081&view=rev Author: gcatania Date: 2012-06-29 16:29:10 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Merged revisions 4080 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4080 | gcatania | 2012-06-29 18:27:22 +0200 (Fri, 29 Jun 2012) | 1 line fix filter metadata support ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4080&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Property Changed: ---------------- branches/openutils-bshd5-backport/ branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/openutils-bshd5:1-4040,4042-4056,4058-4078 + /trunk/openutils-bshd5:1-4040,4042-4056,4058-4080 Modified: svn:mergeinfo - /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078* + /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078*,4080* Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078 + /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078,4080 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078 + /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078,4080 Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:27:22 UTC (rev 4080) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:29:10 UTC (rev 4081) @@ -130,7 +130,7 @@ } Object propertyValue = classMetadata.getPropertyValue(entity, propertyName, entityMode); FilterMetadata fm = currFilterMetadata.get(propertyName); - if (fm != null) + if (fm != null && propertyValue != null) { fm.createFilter(crit, propertyName, propertyValue); continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:27:28
|
Revision: 4080 http://openutils.svn.sourceforge.net/openutils/?rev=4080&view=rev Author: gcatania Date: 2012-06-29 16:27:22 +0000 (Fri, 29 Jun 2012) Log Message: ----------- fix filter metadata support Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:11:44 UTC (rev 4079) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:27:22 UTC (rev 4080) @@ -130,7 +130,7 @@ } Object propertyValue = classMetadata.getPropertyValue(entity, propertyName, entityMode); FilterMetadata fm = currFilterMetadata.get(propertyName); - if (fm != null) + if (fm != null && propertyValue != null) { fm.createFilter(crit, propertyName, propertyValue); continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:11:56
|
Revision: 4079 http://openutils.svn.sourceforge.net/openutils/?rev=4079&view=rev Author: gcatania Date: 2012-06-29 16:11:44 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Merged revisions 4075-4078 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4075 | gcatania | 2012-06-29 16:26:07 +0200 (Fri, 29 Jun 2012) | 1 line cleanup unit tests ........ r4076 | gcatania | 2012-06-29 17:10:22 +0200 (Fri, 29 Jun 2012) | 1 line BSHD-15 source code refactor and cleanup ........ r4077 | gcatania | 2012-06-29 18:03:05 +0200 (Fri, 29 Jun 2012) | 1 line BSHD-2 adding tests for filter metadata, refactoring ........ r4078 | gcatania | 2012-06-29 18:05:56 +0200 (Fri, 29 Jun 2012) | 1 line licenses ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4075&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4076&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4077&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4078&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java Added Paths: ----------- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/EntityBuilder.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java Removed Paths: ------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java Property Changed: ---------------- branches/openutils-bshd5-backport/ branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/openutils-bshd5:1-4040,4042-4056,4058-4073 + /trunk/openutils-bshd5:1-4040,4042-4056,4058-4078 Modified: svn:mergeinfo - /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073* + /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073*,4075-4078* Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073 + /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073,4075-4078 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073 + /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073,4075-4078 Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:05:56 UTC (rev 4078) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -38,7 +38,6 @@ import org.aopalliance.aop.AspectException; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.Hibernate; @@ -167,7 +166,7 @@ */ public List<T> find(String query, Object paramValue, Type paramType) { - return getThis().find(query, new Object[]{paramValue }, new Type[]{paramType }); + return getThis().find(query, new Object[]{paramValue}, new Type[]{paramType}); } /** @@ -724,7 +723,7 @@ * @author gcatania */ @SuppressWarnings("deprecation") - private class LegacySupportCallback<R> extends ExampleTreeCallback<R> + private class LegacySupportCallback<R> extends BaseCallback<R> { private final T rootEntity; @@ -741,7 +740,7 @@ List< ? extends Criterion> additionalCriteria, Order... orders) { - super(new ExampleTree(rootEntity), maxResults, page, orders); + super(maxResults, page, orders); this.rootEntity = rootEntity; this.filterMetadata = metadata; this.additionalCriteria = additionalCriteria; @@ -750,11 +749,7 @@ @Override protected Criteria createCriteria(Session session) { - Criteria crit = super.createCriteria(session); - if (MapUtils.isNotEmpty(filterMetadata)) - { - new FilterMetadataSupport(rootEntity, filterMetadata).appendTo(crit, session); - } + Criteria crit = new FilterMetadataSupport(rootEntity, filterMetadata).create(session); if (additionalCriteria != null) { for (Criterion c : additionalCriteria) @@ -794,8 +789,12 @@ protected Criteria createCriteria(Session session) { Criteria crit = super.createCriteria(session); - if (!CollectionUtils.isEmpty(properties)) + if (CollectionUtils.isEmpty(properties)) { + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + } + else + { ProjectionList projectionList = Projections.projectionList(); for (String property : properties) { @@ -814,7 +813,7 @@ * @author gcatania * @param R the result class */ -class ExampleTreeCallback<R> implements HibernateCallback +abstract class BaseCallback<R> implements HibernateCallback { private final Order[] orders; @@ -823,26 +822,23 @@ private final int page; - private final ExampleTree exampleTree; - - protected ExampleTreeCallback(ExampleTree exampleTree, int maxResults, int page, Order... orders) + protected BaseCallback(int maxResults, int page, Order... orders) { - this.exampleTree = exampleTree; this.maxResults = maxResults; this.page = page; this.orders = orders; } /** - * internal method that creates the query criteria. Subclasses may override but should call {@code super()} + * internal method that creates the query criteria. * @param session the hibernate session * @return the hibernate criteria */ - protected Criteria createCriteria(Session session) + protected abstract Criteria createCriteria(Session session); + + public final List<R> doInHibernate(Session session) throws HibernateException, SQLException { - Criteria crit = exampleTree.create(session); - - crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + Criteria crit = createCriteria(session); crit.setMaxResults(maxResults); crit.setFirstResult(maxResults * page); if (orders != null) @@ -852,13 +848,35 @@ crit.addOrder(o); } } + return crit.list(); + } +} - return crit; + +/** + * @author gcatania + * @param R the result class + */ +class ExampleTreeCallback<R> extends BaseCallback<R> +{ + + private final ExampleTree exampleTree; + + protected ExampleTreeCallback(ExampleTree exampleTree, int maxResults, int page, Order... orders) + { + super(maxResults, page, orders); + this.exampleTree = exampleTree; } - public List<R> doInHibernate(Session session) throws HibernateException, SQLException + /** + * internal method that creates the query criteria. Subclasses may override. + * @param session the hibernate session + * @return the hibernate criteria + */ + @Override + protected Criteria createCriteria(Session session) { - return createCriteria(session).list(); + return exampleTree.create(session); } } @@ -868,9 +886,12 @@ private final List<String> properties; - protected ExampleTreePropertiesCallback(ExampleTree exampleTree, int maxResults, int page, - - List<String> properties, Order... orders) + protected ExampleTreePropertiesCallback( + ExampleTree exampleTree, + int maxResults, + int page, + List<String> properties, + Order... orders) { super(exampleTree, maxResults, page, orders); this.properties = properties; @@ -880,8 +901,12 @@ protected Criteria createCriteria(Session session) { Criteria crit = super.createCriteria(session); - if (!CollectionUtils.isEmpty(properties)) + if (CollectionUtils.isEmpty(properties)) { + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + } + else + { ProjectionList projectionList = Projections.projectionList(); for (String property : properties) { Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 16:05:56 UTC (rev 4078) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -25,11 +25,10 @@ package it.openutils.hibernate.example; +import it.openutils.hibernate.selectors.ExcludeBackrefPropertySelector; + import java.io.Serializable; -import java.lang.reflect.Array; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -37,7 +36,6 @@ import java.util.Map; import java.util.Set; -import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.EntityMode; import org.hibernate.Hibernate; @@ -50,7 +48,6 @@ import org.hibernate.criterion.Restrictions; import org.hibernate.engine.SessionImplementor; import org.hibernate.metadata.ClassMetadata; -import org.hibernate.property.BackrefPropertyAccessor; import org.hibernate.type.Type; @@ -67,7 +64,7 @@ private Character escapeCharacter; - private PropertySelector selector = new ExcludeBackrefPropertySelector(); // BSHD-15 + private PropertySelector selector = new ExcludeBackrefPropertySelector(ExampleTreePropertySelectorSupport.NOT_NULL); // BSHD-15 private MatchMode matchMode; @@ -260,7 +257,7 @@ private void createSubExamples(Criteria crit, Object entity, String[] walkedProperties) { - String associationPath = getAssociationPath(walkedProperties); + String associationPath = ExampleTreeUtils.getPath(walkedProperties); crit.add(example(entity, associationPath)); for (Criterion c : getAdditionalConditions(associationPath)) { @@ -281,7 +278,7 @@ continue; } String propertyName = names[i]; - if (alreadyWalked(walkedProperties, propertyName)) + if (ExampleTreeUtils.alreadyWalked(walkedProperties, propertyName)) { continue; } @@ -289,7 +286,7 @@ Object propertyValue = classMetadata.getPropertyValue(entity, propertyName, entityMode); if (propertyType.isCollectionType()) { - propertyValue = getValueFromCollection(propertyValue); + propertyValue = ExampleTreeUtils.getValueFromCollection(propertyValue); } if (propertyValue == null) { @@ -298,7 +295,7 @@ } Criteria subCrit = crit.createCriteria(propertyName); - String[] subProperties = append(walkedProperties, propertyName); + String[] subProperties = ExampleTreeUtils.append(walkedProperties, propertyName); createSubExamples(subCrit, propertyValue, subProperties); } } @@ -323,11 +320,6 @@ } } - private String getAssociationPath(String[] walkedProperties) - { - return walkedProperties.length > 0 ? StringUtils.join(walkedProperties, '.') : StringUtils.EMPTY; - } - private Example example(Object entity, String associationPath) { Example ex = Example.create(entity); @@ -365,128 +357,13 @@ return result; } - /** - * check the property with the input name was already walked in the input path - * @param path the current path - * @param propertyName the property name about to be walked - * @return true if the property with the input name was already walked in the input path - */ - private boolean alreadyWalked(String[] walkedProperties, String propertyName) - { - if (walkedProperties.length <= 2) - { - return false; - } - String parent = walkedProperties[walkedProperties.length - 1]; - boolean lastWasChild = false; - for (int i = walkedProperties.length - 2; i > 0; i--) - { - String currPropertyName = walkedProperties[i]; - if (currPropertyName.equals(propertyName)) - { - lastWasChild = true; - continue; - } - if (lastWasChild) - { - if (currPropertyName.equals(parent)) - { - return true; - } - else - { - lastWasChild = false; - } - } - } - return false; - } - - // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 - private Object getValueFromCollection(Object collectionValue) - { - if (collectionValue != null) - { - if (collectionValue instanceof Collection< ? >) - { - Collection< ? > coll = (Collection< ? >) collectionValue; - int size = coll.size(); - if (size == 1) - { - return coll.iterator().next(); - } - if (size > 1) - { - throw new IllegalArgumentException("More than one element in filter collection is unsupported."); - } - } - Class< ? extends Object> clazz = collectionValue.getClass(); - if (clazz.isArray()) - { - int length = Array.getLength(collectionValue); - if (length == 1) - { - return Array.get(collectionValue, 0); - } - if (length > 1) - { - throw new IllegalArgumentException("More than one element in filter array is unsupported."); - } - } - // TODO other cases? - } - return null; - } - - private String[] append(String[] propertyNames, String propertyName) - { - String[] result = Arrays.copyOf(propertyNames, propertyNames.length + 1); - result[propertyNames.length] = propertyName; - return result; - } } - } /** - * support for BSHD-15 - * @author gcatania - * @version $Id$ - */ -class ExcludeBackrefPropertySelector implements PropertySelector -{ - - private static final long serialVersionUID = -2803322309158823550L; - - private final PropertySelector selector; - - public ExcludeBackrefPropertySelector(PropertySelector selector) - { - this.selector = selector; - } - - public ExcludeBackrefPropertySelector() - { - selector = ExampleTreePropertySelectorSupport.NOT_NULL; - } - - public boolean include(Object propertyValue, String propertyName, Type type) - { - if (BackrefPropertyAccessor.UNKNOWN.equals(propertyValue)) - { - return false; - } - return selector.include(propertyValue, propertyName, type); - } - -} - - -/** * workaround to {@link Example} not exposing internal property selectors * @author gcatania - * @version $Id$ */ @SuppressWarnings({"serial", "static-method"}) class ExampleTreePropertySelectorSupport Copied: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java (from rev 4078, trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java) =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java (rev 0) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -0,0 +1,147 @@ +/** + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package it.openutils.hibernate.example; + +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.Collection; + +import org.apache.commons.lang3.StringUtils; + + +/** + * @author gcatania + * @version $Id$ + */ +final class ExampleTreeUtils +{ + + private ExampleTreeUtils() + { + } + + /** + * check the property with the input name was already walked in the input path + * @param path the current path + * @param propertyName the property name about to be walked + * @return true if the property with the input name was already walked in the input path + */ + public static boolean alreadyWalked(String[] walkedProperties, String propertyName) + { + if (walkedProperties.length <= 2) + { + return false; + } + String parent = walkedProperties[walkedProperties.length - 1]; + boolean lastWasChild = false; + for (int i = walkedProperties.length - 2; i > 0; i--) + { + String currPropertyName = walkedProperties[i]; + if (currPropertyName.equals(propertyName)) + { + lastWasChild = true; + continue; + } + if (lastWasChild) + { + if (currPropertyName.equals(parent)) + { + return true; + } + else + { + lastWasChild = false; + } + } + } + return false; + } + + /** + * retrieves a value from a collection + * @param collectionValue the collection + * @return a value + * @see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 + * @throws IllegalArgumentException if the input collection contains more than one value + */ + public static Object getValueFromCollection(Object collectionValue) throws IllegalArgumentException + { + if (collectionValue != null) + { + if (collectionValue instanceof Collection< ? >) + { + Collection< ? > coll = (Collection< ? >) collectionValue; + int size = coll.size(); + if (size == 1) + { + return coll.iterator().next(); + } + if (size > 1) + { + throw new IllegalArgumentException("More than one element in filter collection is unsupported."); + } + } + Class< ? extends Object> clazz = collectionValue.getClass(); + if (clazz.isArray()) + { + int length = Array.getLength(collectionValue); + if (length == 1) + { + return Array.get(collectionValue, 0); + } + if (length > 1) + { + throw new IllegalArgumentException("More than one element in filter array is unsupported."); + } + } + // TODO other cases? + } + return null; + } + + /** + * @param strings an array of strings + * @param s the string to append + * @return a new array containing the input string array plus the input string at the end + */ + public static String[] append(String[] strings, String s) + { + String[] result = Arrays.copyOf(strings, strings.length + 1); + result[strings.length] = s; + return result; + } + + /** + * constructs the association path from an array of property names + * @param propertyNames the walked properties + * @return the association path + */ + public static String getPath(String[] propertyNames) + { + return propertyNames.length > 0 ? StringUtils.join(propertyNames, '.') : StringUtils.EMPTY; + } + +} Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:05:56 UTC (rev 4078) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -25,15 +25,13 @@ package it.openutils.hibernate.example; -import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.Collection; +import it.openutils.hibernate.selectors.ExcludeBackrefPropertySelector; + import java.util.HashMap; import java.util.Map; import java.util.Set; import org.apache.commons.collections.MapUtils; -import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.EntityMode; import org.hibernate.Hibernate; @@ -117,7 +115,7 @@ private void createSubExamples(Criteria crit, Object entity, String[] walkedProperties) { - String path = getPath(walkedProperties); + String path = ExampleTreeUtils.getPath(walkedProperties); Map<String, FilterMetadata> currFilterMetadata = getFilterMetadata(path); crit.add(example(entity, currFilterMetadata.keySet())); ClassMetadata classMetadata = sessionFactory.getClassMetadata(Hibernate.getClass(entity)); @@ -126,7 +124,7 @@ for (int i = 0; i < types.length; i++) { String propertyName = names[i]; - if (alreadyWalked(walkedProperties, propertyName)) + if (ExampleTreeUtils.alreadyWalked(walkedProperties, propertyName)) { continue; } @@ -147,7 +145,7 @@ if (propertyType.isCollectionType()) { - propertyValue = getValueFromCollection(propertyValue); + propertyValue = ExampleTreeUtils.getValueFromCollection(propertyValue); } if (propertyValue == null) { @@ -156,7 +154,7 @@ } Criteria subCrit = crit.createCriteria(propertyName); - String[] subProperties = append(walkedProperties, propertyName); + String[] subProperties = ExampleTreeUtils.append(walkedProperties, propertyName); createSubExamples(subCrit, propertyValue, subProperties); } } @@ -174,10 +172,12 @@ { continue; } - String leftover = key.substring(path.length() + 1); - // skip subproperties + // need to take into account leading dot for subproperties + int trimLength = path.isEmpty() ? 0 : path.length() + 1; + String leftover = key.substring(trimLength); if (leftover.contains(".")) { + // skip subproperties continue; } result.put(leftover, filterMetadata.get(key)); @@ -185,15 +185,10 @@ return result; } - private String getPath(String[] walkedProperties) - { - return walkedProperties.length > 0 ? StringUtils.join(walkedProperties, '.') : StringUtils.EMPTY; - } - private Example example(Object entity, Set<String> propertiesToExclude) { Example ex = Example.create(entity); - ex.setPropertySelector(new ExcludeBackrefPropertySelector()); // BSHD-15 + ex.setPropertySelector(new ExcludeBackrefPropertySelector(ExampleTreePropertySelectorSupport.NOT_NULL)); // BSHD-15 for (String propertyName : propertiesToExclude) { // skip properties handled by filterMetadata @@ -202,84 +197,6 @@ return ex; } - /** - * check the property with the input name was already walked in the input path - * @param path the current path - * @param propertyName the property name about to be walked - * @return true if the property with the input name was already walked in the input path - */ - private boolean alreadyWalked(String[] walkedProperties, String propertyName) - { - if (walkedProperties.length <= 2) - { - return false; - } - String parent = walkedProperties[walkedProperties.length - 1]; - boolean lastWasChild = false; - for (int i = walkedProperties.length - 2; i > 0; i--) - { - String currPropertyName = walkedProperties[i]; - if (currPropertyName.equals(propertyName)) - { - lastWasChild = true; - continue; - } - if (lastWasChild) - { - if (currPropertyName.equals(parent)) - { - return true; - } - else - { - lastWasChild = false; - } - } - } - return false; - } - - private Object getValueFromCollection(Object collectionValue) - { - if (collectionValue != null) - { - if (collectionValue instanceof Collection< ? >) - { - Collection< ? > coll = (Collection< ? >) collectionValue; - int size = coll.size(); - if (size == 1) - { - return coll.iterator().next(); - } - if (size > 1) - { - throw new IllegalArgumentException("More than one element in filter collection is unsupported."); - } - } - Class< ? extends Object> clazz = collectionValue.getClass(); - if (clazz.isArray()) - { - int length = Array.getLength(collectionValue); - if (length == 1) - { - return Array.get(collectionValue, 0); - } - if (length > 1) - { - throw new IllegalArgumentException("More than one element in filter array is unsupported."); - } - } - // TODO other cases? - } - return null; - } - - private String[] append(String[] propertyNames, String propertyName) - { - String[] result = Arrays.copyOf(propertyNames, propertyNames.length + 1); - result[propertyNames.length] = propertyName; - return result; - } } } Deleted: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java 2012-06-29 16:05:56 UTC (rev 4078) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -1,66 +0,0 @@ -/** - * - * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) - * - * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl-2.1.html - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package it.openutils.hibernate.selectors; - -import java.io.Serializable; - -import org.hibernate.criterion.Example.PropertySelector; -import org.hibernate.property.BackrefPropertyAccessor; -import org.hibernate.type.Type; - - -/** - * utility selector to avoid class cast exceptions on {@link BackrefPropertyAccessor.UNKNOWN} - * @see BSHD-15 - * @author gcatania - * @version $Id$ - */ -public class ExcludeBackrefPropertySelector implements PropertySelector, Serializable -{ - - private static final long serialVersionUID = -2803322309158823550L; - - private final PropertySelector selector; - - public ExcludeBackrefPropertySelector(PropertySelector selector) - { - if (selector == null) - { - throw new NullPointerException("Null selector."); - } - this.selector = selector; - } - - public boolean include(Object propertyValue, String propertyName, Type type) - { - if (BackrefPropertyAccessor.UNKNOWN.equals(propertyValue)) - { - return false; - } - return selector.include(propertyValue, propertyName, type); - } - -} Copied: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java (from rev 4078, trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java) =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java (rev 0) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -0,0 +1,66 @@ +/** + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package it.openutils.hibernate.selectors; + +import java.io.Serializable; + +import org.hibernate.criterion.Example.PropertySelector; +import org.hibernate.property.BackrefPropertyAccessor; +import org.hibernate.type.Type; + + +/** + * utility selector to avoid class cast exceptions on {@link BackrefPropertyAccessor.UNKNOWN} + * @see BSHD-15 + * @author gcatania + * @version $Id$ + */ +public class ExcludeBackrefPropertySelector implements PropertySelector, Serializable +{ + + private static final long serialVersionUID = -2803322309158823550L; + + private final PropertySelector selector; + + public ExcludeBackrefPropertySelector(PropertySelector selector) + { + if (selector == null) + { + throw new NullPointerException("Null selector."); + } + this.selector = selector; + } + + public boolean include(Object propertyValue, String propertyName, Type type) + { + if (BackrefPropertyAccessor.UNKNOWN.equals(propertyValue)) + { + return false; + } + return selector.include(propertyValue, propertyName, type); + } + +} Copied: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/EntityBuilder.java (from rev 4078, trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java) =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/EntityBuilder.java (rev 0) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/EntityBuilder.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -0,0 +1,180 @@ +/** + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package it.openutils.hibernate.test; + +import it.openutils.hibernate.test.model.Address; +import it.openutils.hibernate.test.model.Car; +import it.openutils.hibernate.test.model.CarMaker; +import it.openutils.hibernate.test.model.CarModel; +import it.openutils.hibernate.test.model.CurrencyAmount; +import it.openutils.hibernate.test.model.Designer; +import it.openutils.hibernate.test.model.FullName; +import it.openutils.hibernate.test.model.Owner; +import it.openutils.hibernate.test.model.Person; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.GregorianCalendar; +import java.util.List; + + +/** + * @author gcatania + * @version $Id$ + */ +public final class EntityBuilder +{ + + private EntityBuilder() + { + } + + public static Person alice() + { + FullName fullName = new FullName("Alice", "McBeal"); + Calendar birthDate = new GregorianCalendar(1970, Calendar.MARCH, 7); + Address address = new Address("Long road", 15, "Smalltown", "MI", 14352); + Person p = new Person(); + p.setName(fullName); + p.setBirthDate(birthDate); + p.setFiscalAddress(address); + p.setCurrentAddress(address); + return p; + } + + public static Owner bob() + { + FullName fullName = new FullName("Bob", "Kelso"); + Calendar birthDate = new GregorianCalendar(1950, Calendar.MARCH, 7); + Address address = new Address("Sacred Heart Lane", 3, "Smalltown", "CA", 11243); + Owner o = new Owner(); + o.setName(fullName); + o.setBirthDate(birthDate); + o.setFiscalAddress(address); + o.setCurrentAddress(address); + return o; + } + + public static Owner chuck() + { + FullName fullName = new FullName("Chuck", "Palahniuk"); + Calendar birthDate = new GregorianCalendar(1962, Calendar.FEBRUARY, 21); + Address address = new Address("Awesome Street", 2, "Pasco", "WA", 13121); + Owner p = new Owner(); + p.setName(fullName); + p.setBirthDate(birthDate); + p.setFiscalAddress(address); + p.setCurrentAddress(address); + return p; + } + + public static CarMaker toyota() + { + CarMaker toyota = new CarMaker(); + toyota.setCode("TYT"); + toyota.setName("Toyota"); + toyota.setCapitalization(new CurrencyAmount(12000, "YEN")); + return toyota; + } + + public static CarMaker fiat() + { + CarMaker fiat = new CarMaker(); + fiat.setCode("FIA"); + fiat.setName("Fabbrica Italiana Automobili Torino"); + fiat.setCapitalization(new CurrencyAmount(80000, "EUR")); + return fiat; + } + + public static CarModel prius(CarMaker toyota) + { + CarModel prius = new CarModel(); + prius.setName("Prius"); + prius.setMake(toyota); + prius.setYear(Integer.valueOf(2008)); + + List<CarModel> toyotaModels = toyota.getModels(); + if (toyotaModels == null) + { + toyotaModels = new ArrayList<CarModel>(); + } + toyotaModels.add(prius); + toyota.setModels(toyotaModels); + return prius; + } + + public static CarModel prius() + { + return prius(toyota()); + } + + public static Designer priusDesigner(CarModel prius) + { + FullName fullName = new FullName("Ken", "Shiro"); + Calendar birthDate = new GregorianCalendar(1981, Calendar.OCTOBER, 16); + Address address = new Address("Khan avenue", 6, "Nagato", "TK", 99867); + Designer p = new Designer(); + p.setName(fullName); + p.setBirthDate(birthDate); + p.setFiscalAddress(address); + p.setCurrentAddress(address); + p.setDepartment("design"); + p.setEmployer(prius.getMake()); + p.setDesignedModels(Collections.singleton(prius)); + p.setGrossAnnualSalary(new CurrencyAmount(60000, "YEN")); + p.setHipsterFactor(97); + return p; + } + + public static Car bobsPrius(Owner bob, CarModel prius) + { + Car bobsPrius = new Car(); + bobsPrius.setModel(prius); + bobsPrius.setRegistrationDate(new GregorianCalendar(2010, Calendar.OCTOBER, 28)); + bobsPrius.setMarketValue(new CurrencyAmount(1700, "USD")); + bobsPrius.setOwner(bob); + bob.setCars(Collections.singleton(bobsPrius)); + return bobsPrius; + } + + public static Car bobsPrius() + { + return bobsPrius(bob(), prius()); + } + + public static Car chucksPrius(Owner chuck, CarModel prius) + { + Car chucksPrius = new Car(); + chucksPrius.setModel(prius); + chucksPrius.setRegistrationDate(new GregorianCalendar(2011, Calendar.DECEMBER, 13)); + chucksPrius.setMarketValue(new CurrencyAmount(5400, "USD")); + chucksPrius.setOwner(chuck); + chuck.setCars(Collections.singleton(chucksPrius)); + return chucksPrius; + } + +} Copied: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java (from rev 4078, trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java) =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java (rev 0) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -0,0 +1,155 @@ +/** + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package it.openutils.hibernate.test; + +import static it.openutils.hibernate.test.EntityBuilder.bobsPrius; +import static it.openutils.hibernate.test.EntityBuilder.chuck; +import static it.openutils.hibernate.test.EntityBuilder.chucksPrius; +import static it.openutils.hibernate.test.EntityBuilder.prius; +import static it.openutils.hibernate.test.EntityBuilder.toyota; +import it.openutils.hibernate.example.FilterMetadata; +import it.openutils.hibernate.test.dao.CarDAO; +import it.openutils.hibernate.test.dao.CarMakerDAO; +import it.openutils.hibernate.test.dao.PersonDAO; +import it.openutils.hibernate.test.dao.StickerDAO; +import it.openutils.hibernate.test.model.Car; +import it.openutils.hibernate.test.model.Sticker; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; +import org.testng.Assert; +import org.testng.annotations.Test; + + +/** + * @author gcatania + */ +@SuppressWarnings("deprecation") +@ContextConfiguration(locations = "/spring-tests.xml") +public class HibernateDAOFilterMetadataTest extends AbstractTransactionalTestNGSpringContextTests +{ + + @Autowired + private PersonDAO personDAO; + + @Autowired + private CarMakerDAO carMakerDAO; + + @Autowired + private CarDAO carDAO; + + @Autowired + private StickerDAO stickerDAO; + + @Test + public void testFindFilterMetadataBasic() + { + Sticker st1 = new Sticker(); + st1.setName("Warning! Baby on board!"); + st1.setHeight(20d); + st1.setWidth(10d); + Sticker st2 = new Sticker(); + st2.setName("Objects in the mirror are losing"); + st2.setHeight(5d); + st2.setWidth(10d); + Sticker st3 = new Sticker(); + st3.setName("(tribal tattoo sticker)"); + st3.setHeight(35d); + st3.setWidth(18d); + + Car chucksPrius = chucksPrius(chuck(), prius(toyota())); + chucksPrius.setStickers(Arrays.asList(st1, st2, st3)); + carDAO.save(chucksPrius); + carDAO.evict(chucksPrius); + + FilterMetadata fm = new FilterMetadata() + { + + public void createFilter(Criteria criteria, String propertyName, Object propertyValue) + { + criteria.add(Restrictions.gt(propertyName, 18d)); + criteria.add(Restrictions.lt(propertyName, 22d)); + } + }; + List<Sticker> found = stickerDAO.findFiltered(new Sticker(), Collections.singletonMap("height", fm)); + Assert.assertEquals(found.size(), 1); + Assert.assertEquals(found.get(0), st1); + } + + @Test + public void testFindFilterMetadataOnChildProperty() + { + Sticker st1 = new Sticker(); + st1.setName("Warning! Baby on board!"); + st1.setHeight(20d); + st1.setWidth(10d); + Sticker st2 = new Sticker(); + st2.setName("Objects in the mirror are losing"); + st2.setHeight(5d); + st2.setWidth(10d); + Sticker st3 = new Sticker(); + st3.setName("(tribal tattoo sticker)"); + st3.setHeight(35d); + st3.setWidth(18d); + + Car chucksPrius = chucksPrius(chuck(), prius(toyota())); + chucksPrius.setStickers(Arrays.asList(st1, st2, st3)); + + Car bobsPrius = bobsPrius(); + bobsPrius.setStickers(Arrays.asList(st2.clone())); + + carDAO.save(chucksPrius); + carDAO.evict(chucksPrius); + carDAO.save(bobsPrius); + carDAO.evict(bobsPrius); + + FilterMetadata fm = new FilterMetadata() + { + + public void createFilter(Criteria criteria, String propertyName, Object propertyValue) + { + criteria.add(Restrictions.gt(propertyName, 18d)); + criteria.add(Restrictions.lt(propertyName, 22d)); + } + }; + Car filter = new Car(); + filter.setStickers(Collections.singletonList(new Sticker())); + List<Car> found = carDAO.findFiltered(filter, Collections.singletonMap("stickers.height", fm)); + Assert.assertEquals(found.size(), 1); + Car actual = found.get(0); + Assert.assertEquals(actual.getStickers().size(), 3); + // full fledged equality fails because of Object.equals() on PersistentBag + Assert.assertEquals(actual.getOwner().getName(), chucksPrius.getOwner().getName()); + } + +} Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-06-29 16:05:56 UTC (rev 4078) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-06-29 16:11:44 UTC (rev 4079) @@ -25,6 +25,15 @@ package it.openutils.hibernate.test; +import static it.openutils.hibernate.test.EntityBuilder.alice; +import static it.openutils.hibernate.test.EntityBuilder.bob; +import static it.openutils.hibernate.test.EntityBuilder.bobsPrius; +import static it.openutils.hibernate.test.EntityBuilder.chuck; +import static it.openutils.hibernate.test.EntityBuilder.chucksPrius; +import static it.openutils.hibernate.test.EntityBuilder.fiat; +import static it.openutils.hibernate.test.EntityBuilder.prius; +import static it.openutils.hibernate.test.EntityBuilder.priusDesigner; +import static it.openutils.hibernate.test.EntityBuilder.toyota; import it.openutils.hibernate.test.dao.CarDAO; import it.openutils.hibernate.test.dao.CarMakerDAO; import it.openutils.hibernate.test.dao.PersonDAO; @@ -40,11 +49,8 @@ import it.openutils.hibernate.test.model.Person; import it.openutils.hibernate.test.model.Sticker; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Calendar; import java.util.Collections; -import java.util.GregorianCalendar; import java.util.List; import org.hibernate.criterion.Example; @@ -80,120 +86,6 @@ @Autowired private StickerDAO stickerDAO; - private static Person alice() - { - FullName fullName = new FullName("Alice", "McBeal"); - Calendar birthDate = new GregorianCalendar(1970, Calendar.MARCH, 7); - Address address = new Address("Long road", 15, "Smalltown", "MI", 14352); - Person p = new Person(); - p.setName(fullName); - p.setBirthDate(birthDate); - p.setFiscalAddress(address); - p.setCurrentAddress(address); - return p; - } - - private static Owner bob() - { - FullName fullName = new FullName("Bob", "Kelso"); - Calendar birthDate = new GregorianCalendar(1950, Calendar.MARCH, 7); - Address address = new Address("Sacred Heart Lane", 3, "Smalltown", "CA", 11243); - Owner o = new Owner(); - o.setName(fullName); - o.setBirthDate(birthDate); - o.setFiscalAddress(address); - o.setCurrentAddress(address); - return o; - } - - private static Owner chuck() - { - FullName fullName = new FullName("Chuck", "Palahniuk"); - Calendar birthDate = new GregorianCalendar(1962, Calendar.FEBRUARY, 21); - Address address = new Address("Awesome Street", 2, "Pasco", "WA", 13121); - Owner p = new Owner(); - p.setName(fullName); - p.setBirthDate(birthDate); - p.setFiscalAddress(address); - p.setCurrentAddress(address); - return p; - } - - private static CarMaker toyota() - { - CarMaker toyota = new CarMaker(); - toyota.setCode("TYT"); - toyota.setName("Toyota"); - toyota.setCapitalization(new CurrencyAmount(12000, "YEN")); - return toyota; - } - - private static CarMaker fiat() - { - CarMaker fiat = new CarMaker(); - fiat.setCode("FIA"); - fiat.setName("Fabbrica Italiana Automobili Torino"); - fiat.setCapitalization(new CurrencyAmount(80000, "EUR")); - return fiat; - } - - private static CarModel prius(CarMaker toyota) - { - CarModel prius = new CarModel(); - prius.setName("Prius"); - prius.setMake(toyota); - prius.setYear(Integer.valueOf(2008)); - - List<CarModel> toyotaModels = toyota.getModels(); - if (toyotaModels == null) - { - toyotaModels = new ArrayList<CarModel>(); - } - toyotaModels.add(prius); - toyota.setModels(toyotaModels); - return prius; - } - - private static Designer priusDesigner(CarModel prius) - { - FullName fullName = new FullName("Ken", "Shiro"); - Calendar birthDate = new GregorianCalendar(1981, Calendar.OCTOBER, 16); - Address address = new Address("Khan avenue", 6, "Nagato", "TK", 99867); - Designer p = new Designer(); - p.setName(fullName); - p.setBirthDate(birthDate); - p.setFiscalAddress(address); - p.setCurrentAddress(address); - p.setDepartment("design"); - p.setEmployer(prius.getMake()); - p.setDesignedModels(Collections.singleton(prius)); - p.setGrossAnnualSalary(new CurrencyAmount(60000, "YEN")); - p.setHipsterFactor(97); - return p; - } - - private static Car bobsPrius(Owner bob, CarModel prius) - { - Car bobsPrius = new Car(); - bobsPrius.setModel(prius); - bobsPrius.setRegistrationDate(new GregorianCalendar(2010, Calendar.OCTOBER, 28)); - bobsPrius.setMarketValue(new CurrencyAmount(1700, "USD")); - bobsPrius.setOwner(bob); - bob.setCars(Collections.singleton(bobsPrius)); - return bobsPrius; - } - - private static Car chucksPrius(Owner chuck, CarModel prius) - { - Car chucksPrius = new Car(); - chucksPrius.setModel(prius); - chucksPrius.setRegistrationDate(new GregorianCalendar(2011, Calendar.DECEMBER, 13)); - chucksPrius.setMarketValue(new CurrencyAmount(5400, "USD")); - chucksPrius.setOwner(chuck); - chuck.setCars(Collections.singleton(chucksPrius)); - return chucksPrius; - } - /** * basic save/evict/get test. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 16:06:06
|
Revision: 4078 http://openutils.svn.sourceforge.net/openutils/?rev=4078&view=rev Author: gcatania Date: 2012-06-29 16:05:56 +0000 (Fri, 29 Jun 2012) Log Message: ----------- licenses Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java 2012-06-29 16:03:05 UTC (rev 4077) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java 2012-06-29 16:05:56 UTC (rev 4078) @@ -1,6 +1,28 @@ /** - * Copyright (c) Energeya LLC. All rights reserved. http://www.energeya.com + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + package it.openutils.hibernate.example; import java.lang.reflect.Array; Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java 2012-06-29 16:03:05 UTC (rev 4077) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java 2012-06-29 16:05:56 UTC (rev 4078) @@ -1,6 +1,28 @@ /** - * Copyright (c) Energeya LLC. All rights reserved. http://www.energeya.com + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + package it.openutils.hibernate.selectors; import java.io.Serializable; Modified: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java 2012-06-29 16:03:05 UTC (rev 4077) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java 2012-06-29 16:05:56 UTC (rev 4078) @@ -1,6 +1,28 @@ /** - * Copyright (c) Energeya LLC. All rights reserved. http://www.energeya.com + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + package it.openutils.hibernate.test; import it.openutils.hibernate.test.model.Address; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2012-06-29 16:04:19
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/68/changes> Changes: [gcatania] BSHD-15 source code refactor and cleanup ------------------------------------------ [...truncated 668 lines...] TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 5 Hibernate: insert into Sticker (id, height, name, width, carId) values (default, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 Hibernate: update Sticker set carId=? where id=? TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 2 Hibernate: select this_.id as id1_25_, this_.amount as amount1_25_, this_.currency as currency1_25_, this_.model_id as model5_1_25_, this_.owner_id as owner6_1_25_, this_.registrationDate as registra4_1_25_, carmodel1_.id as id3_0_, carmodel1_.make_code as make4_3_0_, carmodel1_.name as name3_0_, carmodel1_.year as year3_0_, carmaker2_.code as code2_1_, carmaker2_.amount as amount2_1_, carmaker2_.currency as currency2_1_, carmaker2_.name as name2_1_, carmodel3_.id as id3_2_, carmodel3_.make_code as make4_3_2_, carmodel3_.name as name3_2_, carmodel3_.year as year3_2_, carmaker4_.code as code2_3_, carmaker4_.amount as amount2_3_, carmaker4_.currency as currency2_3_, carmaker4_.name as name2_3_, owner5_.id as id4_4_, owner5_1_.birthDate as birthDate4_4_, owner5_1_.currentAddress_id as currentA6_4_4_, owner5_1_.fiscalAddress_id as fiscalAd7_4_4_, owner5_1_.familyName as familyName4_4_, owner5_1_.givenName as givenName4_4_, owner5_1_.title as title4_4_, address6_.id as id0_5_, address6_.city as city0_5_, address6_.county as county0_5_, address6_.no as no0_5_, address6_.street as street0_5_, address6_.zipCode as zipCode0_5_, address7_.id as id0_6_, address7_.city as city0_6_, address7_.county as county0_6_, address7_.no as no0_6_, address7_.street as street0_6_, address7_.zipCode as zipCode0_6_, car8_.id as id1_7_, car8_.amount as amount1_7_, car8_.currency as currency1_7_, car8_.model_id as model5_1_7_, car8_.owner_id as owner6_1_7_, car8_.registrationDate as registra4_1_7_, carmodel9_.id as id3_8_, carmodel9_.make_code as make4_3_8_, carmodel9_.name as name3_8_, carmodel9_.year as year3_8_, carmaker10_.code as code2_9_, carmaker10_.amount as amount2_9_, carmaker10_.currency as currency2_9_, carmaker10_.name as name2_9_, carmodel11_.id as id3_10_, carmodel11_.make_code as make4_3_10_, carmodel11_.name as name3_10_, carmodel11_.year as year3_10_, carmaker12_.code as code2_11_, carmaker12_.amount as amount2_11_, carmaker12_.currency as currency2_11_, carmaker12_.name as name2_11_, owner13_.id as id4_12_, owner13_1_.birthDate as birthDate4_12_, owner13_1_.currentAddress_id as currentA6_4_12_, owner13_1_.fiscalAddress_id as fiscalAd7_4_12_, owner13_1_.familyName as familyName4_12_, owner13_1_.givenName as givenName4_12_, owner13_1_.title as title4_12_, address14_.id as id0_13_, address14_.city as city0_13_, address14_.county as county0_13_, address14_.no as no0_13_, address14_.street as street0_13_, address14_.zipCode as zipCode0_13_, address15_.id as id0_14_, address15_.city as city0_14_, address15_.county as county0_14_, address15_.no as no0_14_, address15_.street as street0_14_, address15_.zipCode as zipCode0_14_, car16_.id as id1_15_, car16_.amount as amount1_15_, car16_.currency as currency1_15_, car16_.model_id as model5_1_15_, car16_.owner_id as owner6_1_15_, car16_.registrationDate as registra4_1_15_, carmodel17_.id as id3_16_, carmodel17_.make_code as make4_3_16_, carmodel17_.name as name3_16_, carmodel17_.year as year3_16_, carmaker18_.code as code2_17_, carmaker18_.amount as amount2_17_, carmaker18_.currency as currency2_17_, carmaker18_.name as name2_17_, carmodel19_.id as id3_18_, carmodel19_.make_code as make4_3_18_, carmodel19_.name as name3_18_, carmodel19_.year as year3_18_, carmaker20_.code as code2_19_, carmaker20_.amount as amount2_19_, carmaker20_.currency as currency2_19_, carmaker20_.name as name2_19_, owner44_.id as id4_20_, owner44_1_.birthDate as birthDate4_20_, owner44_1_.currentAddress_id as currentA6_4_20_, owner44_1_.fiscalAddress_id as fiscalAd7_4_20_, owner44_1_.familyName as familyName4_20_, owner44_1_.givenName as givenName4_20_, owner44_1_.title as title4_20_, address45_.id as id0_21_, address45_.city as city0_21_, address45_.county as county0_21_, address45_.no as no0_21_, address45_.street as street0_21_, address45_.zipCode as zipCode0_21_, address46_.id as id0_22_, address46_.city as city0_22_, address46_.county as county0_22_, address46_.no as no0_22_, address46_.street as street0_22_, address46_.zipCode as zipCode0_22_, sticker21_.id as id8_23_, sticker21_.height as height8_23_, sticker21_.name as name8_23_, sticker21_.width as width8_23_, sticker22_.id as id8_24_, sticker22_.height as height8_24_, sticker22_.name as name8_24_, sticker22_.width as width8_24_ from Car this_ inner join CarModel carmodel1_ on this_.model_id=carmodel1_.id inner join CarMaker carmaker2_ on carmodel1_.make_code=carmaker2_.code inner join CarModel carmodel3_ on carmaker2_.code=carmodel3_.make_code inner join CarMaker carmaker4_ on carmodel3_.make_code=carmaker4_.code inner join Owner owner5_ on this_.owner_id=owner5_.id left outer join Person owner5_1_ on owner5_.id=owner5_1_.id inner join Address address6_ on owner5_1_.currentAddress_id=address6_.id inner join Address address7_ on owner5_1_.fiscalAddress_id=address7_.id inner join Car car8_ on owner5_.id=car8_.owner_id inner join CarModel carmodel9_ on car8_.model_id=carmodel9_.id inner join CarMaker carmaker10_ on carmodel9_.make_code=carmaker10_.code inner join CarModel carmodel11_ on carmaker10_.code=carmodel11_.make_code inner join CarMaker carmaker12_ on carmodel11_.make_code=carmaker12_.code inner join Owner owner13_ on car8_.owner_id=owner13_.id left outer join Person owner13_1_ on owner13_.id=owner13_1_.id inner join Address address14_ on owner13_1_.currentAddress_id=address14_.id inner join Address address15_ on owner13_1_.fiscalAddress_id=address15_.id inner join Car car16_ on owner13_.id=car16_.owner_id inner join CarModel carmodel17_ on car16_.model_id=carmodel17_.id inner join CarMaker carmaker18_ on carmodel17_.make_code=carmaker18_.code inner join CarModel carmodel19_ on carmaker18_.code=carmodel19_.make_code inner join CarMaker carmaker20_ on carmodel19_.make_code=carmaker20_.code left outer join Owner owner44_ on car16_.owner_id=owner44_.id left outer join Person owner44_1_ on owner44_.id=owner44_1_.id left outer join Address address45_ on owner44_1_.currentAddress_id=address45_.id left outer join Address address46_ on owner44_1_.fiscalAddress_id=address46_.id inner join Sticker sticker21_ on car16_.id=sticker21_.carId inner join Sticker sticker22_ on car8_.id=sticker22_.carId where (this_.amount=? and this_.currency=? and this_.registrationDate=?) and this_.id = ? and (carmodel1_.name=? and carmodel1_.year=?) and carmodel1_.id = ? and (carmaker2_.amount=? and carmaker2_.currency=? and carmaker2_.name=?) and carmaker2_.code = ? and (carmodel3_.name=? and carmodel3_.year=?) and carmodel3_.id = ? and (carmaker4_.amount=? and carmaker4_.currency=? and carmaker4_.name=?) and carmaker4_.code = ? and (owner5_1_.birthDate=? and owner5_1_.familyName=? and owner5_1_.givenName=?) and owner5_.id = ? and (address6_.city=? and address6_.county=? and address6_.no=? and address6_.street=? and address6_.zipCode=?) and address6_.id = ? and (address7_.city=? and address7_.county=? and address7_.no=? and address7_.street=? and address7_.zipCode=?) and address7_.id = ? and (car8_.amount=? and car8_.currency=? and car8_.registrationDate=?) and car8_.id = ? and (carmodel9_.name=? and carmodel9_.year=?) and carmodel9_.id = ? and (carmaker10_.amount=? and carmaker10_.currency=? and carmaker10_.name=?) and carmaker10_.code = ? and (carmodel11_.name=? and carmodel11_.year=?) and carmodel11_.id = ? and (carmaker12_.amount=? and carmaker12_.currency=? and carmaker12_.name=?) and carmaker12_.code = ? and (owner13_1_.birthDate=? and owner13_1_.familyName=? and owner13_1_.givenName=?) and owner13_.id = ? and (address14_.city=? and address14_.county=? and address14_.no=? and address14_.street=? and address14_.zipCode=?) and address14_.id = ? and (address15_.city=? and address15_.county=? and address15_.no=? and address15_.street=? and address15_.zipCode=?) and address15_.id = ? and (car16_.amount=? and car16_.currency=? and car16_.registrationDate=?) and car16_.id = ? and (carmodel17_.name=? and carmodel17_.year=?) and carmodel17_.id = ? and (carmaker18_.amount=? and carmaker18_.currency=? and carmaker18_.name=?) and carmaker18_.code = ? and (carmodel19_.name=? and carmodel19_.year=?) and carmodel19_.id = ? and (carmaker20_.amount=? and carmaker20_.currency=? and carmaker20_.name=?) and carmaker20_.code = ? and (sticker21_.height=? and sticker21_.name=? and sticker21_.width=?) and sticker21_.id = ? and (sticker22_.height=? and sticker22_.name=? and sticker22_.width=?) and sticker22_.id = ? limit ? TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 5 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 7 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 8 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 9 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 10 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 11 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 12 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 13 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 14 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 15 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 16 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 17 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 18 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 19 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 20 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 21 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 22 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 23 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 24 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 25 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 26 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 27 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 28 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 29 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 30 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 31 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 32 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 33 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 34 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 35 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 36 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 37 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 38 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 39 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 40 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 41 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 42 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 43 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 44 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 45 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 46 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 47 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 48 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 49 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 50 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 51 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 52 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 53 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 54 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 55 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 56 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 57 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 58 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 59 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 60 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 61 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 62 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 63 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 64 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 65 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 66 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 67 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 68 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 69 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 70 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 71 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 72 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 73 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 74 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 75 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 76 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 77 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 78 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 79 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 80 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 81 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 82 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 83 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 84 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 85 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 86 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 87 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 88 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 89 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 90 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 91 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 92 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 93 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 94 TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_0_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_1_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_2_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_3_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_4_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_5_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_6_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_7_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_8_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_9_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_10_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_11_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_12_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_13_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_14_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_15_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_16_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_17_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_18_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_19_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_20_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_21_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_22_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_23_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_24_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_25_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@11e7cc6 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testOneToMany@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (12): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1c66ec7]; rollback [true] Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Smalltown' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'MI' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '15' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Long road' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '14352' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1970-03-07 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'McBeal' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Alice' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: select person0_.id as id4_3_, person0_.birthDate as birthDate4_3_, person0_.currentAddress_id as currentA6_4_3_, person0_.fiscalAddress_id as fiscalAd7_4_3_, person0_.familyName as familyName4_3_, person0_.givenName as givenName4_3_, person0_.title as title4_3_, person0_1_.department as department5_3_, person0_1_.employedSince as employed2_5_3_, person0_1_.employer_code as employer7_5_3_, person0_1_.amount as amount5_3_, person0_1_.currency as currency5_3_, person0_1_.qualification as qualific5_5_3_, person0_2_.hipsterFactor as hipsterF1_6_3_, case when person0_2_.id is not null then 2 when person0_1_.id is not null then 1 when person0_3_.id is not null then 3 when person0_.id is not null then 0 end as clazz_3_, address1_.id as id0_0_, address1_.city as city0_0_, address1_.county as county0_0_, address1_.no as no0_0_, address1_.street as street0_0_, address1_.zipCode as zipCode0_0_, address2_.id as id0_1_, address2_.city as city0_1_, address2_.county as county0_1_, address2_.no as no0_1_, address2_.street as street0_1_, address2_.zipCode as zipCode0_1_, carmaker3_.code as code2_2_, carmaker3_.amount as amount2_2_, carmaker3_.currency as currency2_2_, carmaker3_.name as name2_2_ from Person person0_ left outer join Employee person0_1_ on person0_.id=person0_1_.id left outer join Designer person0_2_ on person0_.id=person0_2_.id left outer join Owner person0_3_ on person0_.id=person0_3_.id inner join Address address1_ on person0_.currentAddress_id=address1_.id left outer join Address address2_ on person0_.fiscalAddress_id=address2_.id left outer join CarMaker carmaker3_ on person0_1_.employer_code=carmaker3_.code where person0_.id=? TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_1_ TRACE - NullableType.nullSafeGet(189) | returning null as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning 'Smalltown' as column: city0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'MI' as column: county0_0_ TRACE - NullableType.nullSafeGet(195) | returning '15' as column: no0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'Long road' as column: street0_0_ TRACE - NullableType.nullSafeGet(195) | returning '14352' as column: zipCode0_0_ TRACE - NullableType.nullSafeGet(195) | returning '0' as column: clazz_3_ TRACE - NullableType.nullSafeGet(195) | returning '1970-03-07 00:00:00' as column: birthDate4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: currentA6_4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: fiscalAd7_4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'McBeal' as column: familyName4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'Alice' as column: givenName4_3_ DEBUG - EnumType.nullSafeGet(103) | Returning null as column title4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@11e7cc6 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveBasic@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (13): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1c66ec7]; rollback [true] Hibernate: insert into CarMaker (amount, currency, name, code) values (?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 4 Hibernate: insert into CarModel (id, make_code, name, year) values (default, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 3 Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Nagato' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'TK' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '6' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Khan avenue' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '99867' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Shiro' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Ken' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: insert into Employee (department, employedSince, employer_code, amount, currency, qualification, id) values (?, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'design' to parameter: 1 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '60000.0' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 5 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 7 Hibernate: insert into Designer (hipsterFactor, id) values (?, ?) TRACE - NullableType.nullSafeSet(153) | binding '97' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 Hibernate: select this_.id as id4_3_, this_.birthDate as birthDate4_3_, this_.currentAddress_id as currentA6_4_3_, this_.fiscalAddress_id as fiscalAd7_4_3_, this_.familyName as familyName4_3_, this_.givenName as givenName4_3_, this_.title as title4_3_, this_1_.department as department5_3_, this_1_.employedSince as employed2_5_3_, this_1_.employer_code as employer7_5_3_, this_1_.amount as amount5_3_, this_1_.currency as currency5_3_, this_1_.qualification as qualific5_5_3_, this_2_.hipsterFactor as hipsterF1_6_3_, case when this_2_.id is not null then 2 when this_1_.id is not null then 1 when this_3_.id is not null then 3 when this_.id is not null then 0 end as clazz_3_, address2_.id as id0_0_, address2_.city as city0_0_, address2_.county as county0_0_, address2_.no as no0_0_, address2_.street as street0_0_, address2_.zipCode as zipCode0_0_, address3_.id as id0_1_, address3_.city as city0_1_, address3_.county as county0_1_, address3_.no as no0_1_, address3_.street as street0_1_, address3_.zipCode as zipCode0_1_, carmaker4_.code as code2_2_, carmaker4_.amount as amount2_2_, carmaker4_.currency as currency2_2_, carmaker4_.name as name2_2_ from Person this_ left outer join Employee this_1_ on this_.id=this_1_.id left outer join Designer this_2_ on this_.id=this_2_.id left outer join Owner this_3_ on this_.id=this_3_.id inner join Address address2_ on this_.currentAddress_id=address2_.id left outer join Address address3_ on this_.fiscalAddress_id=address3_.id left outer join CarMaker carmaker4_ on this_1_.employer_code=carmaker4_.code where (this_.birthDate=?) limit ? TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_1_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@11e7cc6 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveWithCascade@HibernateDAOPersistenceTest, testException = [null]]] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.411 sec Results : Tests run: 18, Failures: 0, Errors: 0, Skipped: 0 INFO - AbstractApplicationContext.doClose(938) | Closing org.springframework.context.support.GenericApplicationContext@50ca0c: startup date [Fri Jun 29 17:39:28 CEST 2012]; root of context hierarchy INFO - DefaultSingletonBeanRegistry.destroySingletons(421) | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d2b9b7: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,carDAO,carMakerDAO,personDAO,stickerDAO,dataSource,sessionFactory,transactionManager]; root of factory hierarchy INFO - AbstractSessionFactoryBean.destroy(246) | Closing Hibernate SessionFactory INFO - SessionFactoryImpl.close(940) | closing INFO - SchemaExport.execute(226) | Running hbm2ddl schema export INFO - SchemaExport.execute(251) | exporting generated schema to database INFO - SchemaExport.execute(268) | schema export complete [JENKINS] Recording test results [INFO] [bundle:bundle {execution: default-bundle}] [INFO] Preparing source:jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [INFO] No goals needed for project - skipping [INFO] [source:jar {execution: attach-sources}] [INFO] Building jar: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> [INFO] [assembly:single {execution: bundle}] [INFO] Reading assembly descriptor: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/src/main/assembly/assembly-bundle.xml> [INFO] Building zip: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT-bundle.zip> [INFO] [license:check {execution: default}] [INFO] Checking licenses... [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java> [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java> [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java> [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/pom.xml> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_17-39-11/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/pom.xml [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_17-39-11/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT.jar [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_17-39-11/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Some files do not have the expected license header [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 24 seconds [INFO] Finished at: Fri Jun 29 17:39:40 CEST 2012 [INFO] Final Memory: 52M/293M [INFO] ------------------------------------------------------------------------ Sending e-mails to: ope...@li... channel stopped |
From: <hu...@op...> - 2012-06-29 16:04:18
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/68/changes> Changes: [gcatania] BSHD-15 source code refactor and cleanup ------------------------------------------ [...truncated 654 lines...] TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 5 Hibernate: insert into Sticker (id, height, name, width, carId) values (default, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 Hibernate: update Sticker set carId=? where id=? TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 2 Hibernate: select this_.id as id1_25_, this_.amount as amount1_25_, this_.currency as currency1_25_, this_.model_id as model5_1_25_, this_.owner_id as owner6_1_25_, this_.registrationDate as registra4_1_25_, carmodel1_.id as id3_0_, carmodel1_.make_code as make4_3_0_, carmodel1_.name as name3_0_, carmodel1_.year as year3_0_, carmaker2_.code as code2_1_, carmaker2_.amount as amount2_1_, carmaker2_.currency as currency2_1_, carmaker2_.name as name2_1_, carmodel3_.id as id3_2_, carmodel3_.make_code as make4_3_2_, carmodel3_.name as name3_2_, carmodel3_.year as year3_2_, carmaker4_.code as code2_3_, carmaker4_.amount as amount2_3_, carmaker4_.currency as currency2_3_, carmaker4_.name as name2_3_, owner5_.id as id4_4_, owner5_1_.birthDate as birthDate4_4_, owner5_1_.currentAddress_id as currentA6_4_4_, owner5_1_.fiscalAddress_id as fiscalAd7_4_4_, owner5_1_.familyName as familyName4_4_, owner5_1_.givenName as givenName4_4_, owner5_1_.title as title4_4_, address6_.id as id0_5_, address6_.city as city0_5_, address6_.county as county0_5_, address6_.no as no0_5_, address6_.street as street0_5_, address6_.zipCode as zipCode0_5_, address7_.id as id0_6_, address7_.city as city0_6_, address7_.county as county0_6_, address7_.no as no0_6_, address7_.street as street0_6_, address7_.zipCode as zipCode0_6_, car8_.id as id1_7_, car8_.amount as amount1_7_, car8_.currency as currency1_7_, car8_.model_id as model5_1_7_, car8_.owner_id as owner6_1_7_, car8_.registrationDate as registra4_1_7_, carmodel9_.id as id3_8_, carmodel9_.make_code as make4_3_8_, carmodel9_.name as name3_8_, carmodel9_.year as year3_8_, carmaker10_.code as code2_9_, carmaker10_.amount as amount2_9_, carmaker10_.currency as currency2_9_, carmaker10_.name as name2_9_, carmodel11_.id as id3_10_, carmodel11_.make_code as make4_3_10_, carmodel11_.name as name3_10_, carmodel11_.year as year3_10_, carmaker12_.code as code2_11_, carmaker12_.amount as amount2_11_, carmaker12_.currency as currency2_11_, carmaker12_.name as name2_11_, owner13_.id as id4_12_, owner13_1_.birthDate as birthDate4_12_, owner13_1_.currentAddress_id as currentA6_4_12_, owner13_1_.fiscalAddress_id as fiscalAd7_4_12_, owner13_1_.familyName as familyName4_12_, owner13_1_.givenName as givenName4_12_, owner13_1_.title as title4_12_, address14_.id as id0_13_, address14_.city as city0_13_, address14_.county as county0_13_, address14_.no as no0_13_, address14_.street as street0_13_, address14_.zipCode as zipCode0_13_, address15_.id as id0_14_, address15_.city as city0_14_, address15_.county as county0_14_, address15_.no as no0_14_, address15_.street as street0_14_, address15_.zipCode as zipCode0_14_, car16_.id as id1_15_, car16_.amount as amount1_15_, car16_.currency as currency1_15_, car16_.model_id as model5_1_15_, car16_.owner_id as owner6_1_15_, car16_.registrationDate as registra4_1_15_, carmodel17_.id as id3_16_, carmodel17_.make_code as make4_3_16_, carmodel17_.name as name3_16_, carmodel17_.year as year3_16_, carmaker18_.code as code2_17_, carmaker18_.amount as amount2_17_, carmaker18_.currency as currency2_17_, carmaker18_.name as name2_17_, carmodel19_.id as id3_18_, carmodel19_.make_code as make4_3_18_, carmodel19_.name as name3_18_, carmodel19_.year as year3_18_, carmaker20_.code as code2_19_, carmaker20_.amount as amount2_19_, carmaker20_.currency as currency2_19_, carmaker20_.name as name2_19_, owner44_.id as id4_20_, owner44_1_.birthDate as birthDate4_20_, owner44_1_.currentAddress_id as currentA6_4_20_, owner44_1_.fiscalAddress_id as fiscalAd7_4_20_, owner44_1_.familyName as familyName4_20_, owner44_1_.givenName as givenName4_20_, owner44_1_.title as title4_20_, address45_.id as id0_21_, address45_.city as city0_21_, address45_.county as county0_21_, address45_.no as no0_21_, address45_.street as street0_21_, address45_.zipCode as zipCode0_21_, address46_.id as id0_22_, address46_.city as city0_22_, address46_.county as county0_22_, address46_.no as no0_22_, address46_.street as street0_22_, address46_.zipCode as zipCode0_22_, sticker21_.id as id8_23_, sticker21_.height as height8_23_, sticker21_.name as name8_23_, sticker21_.width as width8_23_, sticker22_.id as id8_24_, sticker22_.height as height8_24_, sticker22_.name as name8_24_, sticker22_.width as width8_24_ from Car this_ inner join CarModel carmodel1_ on this_.model_id=carmodel1_.id inner join CarMaker carmaker2_ on carmodel1_.make_code=carmaker2_.code inner join CarModel carmodel3_ on carmaker2_.code=carmodel3_.make_code inner join CarMaker carmaker4_ on carmodel3_.make_code=carmaker4_.code inner join Owner owner5_ on this_.owner_id=owner5_.id left outer join Person owner5_1_ on owner5_.id=owner5_1_.id inner join Address address6_ on owner5_1_.currentAddress_id=address6_.id inner join Address address7_ on owner5_1_.fiscalAddress_id=address7_.id inner join Car car8_ on owner5_.id=car8_.owner_id inner join CarModel carmodel9_ on car8_.model_id=carmodel9_.id inner join CarMaker carmaker10_ on carmodel9_.make_code=carmaker10_.code inner join CarModel carmodel11_ on carmaker10_.code=carmodel11_.make_code inner join CarMaker carmaker12_ on carmodel11_.make_code=carmaker12_.code inner join Owner owner13_ on car8_.owner_id=owner13_.id left outer join Person owner13_1_ on owner13_.id=owner13_1_.id inner join Address address14_ on owner13_1_.currentAddress_id=address14_.id inner join Address address15_ on owner13_1_.fiscalAddress_id=address15_.id inner join Car car16_ on owner13_.id=car16_.owner_id inner join CarModel carmodel17_ on car16_.model_id=carmodel17_.id inner join CarMaker carmaker18_ on carmodel17_.make_code=carmaker18_.code inner join CarModel carmodel19_ on carmaker18_.code=carmodel19_.make_code inner join CarMaker carmaker20_ on carmodel19_.make_code=carmaker20_.code left outer join Owner owner44_ on car16_.owner_id=owner44_.id left outer join Person owner44_1_ on owner44_.id=owner44_1_.id left outer join Address address45_ on owner44_1_.currentAddress_id=address45_.id left outer join Address address46_ on owner44_1_.fiscalAddress_id=address46_.id inner join Sticker sticker21_ on car16_.id=sticker21_.carId inner join Sticker sticker22_ on car8_.id=sticker22_.carId where (this_.amount=? and this_.currency=? and this_.registrationDate=?) and this_.id = ? and (carmodel1_.name=? and carmodel1_.year=?) and carmodel1_.id = ? and (carmaker2_.amount=? and carmaker2_.currency=? and carmaker2_.name=?) and carmaker2_.code = ? and (carmodel3_.name=? and carmodel3_.year=?) and carmodel3_.id = ? and (carmaker4_.amount=? and carmaker4_.currency=? and carmaker4_.name=?) and carmaker4_.code = ? and (owner5_1_.birthDate=? and owner5_1_.familyName=? and owner5_1_.givenName=?) and owner5_.id = ? and (address6_.city=? and address6_.county=? and address6_.no=? and address6_.street=? and address6_.zipCode=?) and address6_.id = ? and (address7_.city=? and address7_.county=? and address7_.no=? and address7_.street=? and address7_.zipCode=?) and address7_.id = ? and (car8_.amount=? and car8_.currency=? and car8_.registrationDate=?) and car8_.id = ? and (carmodel9_.name=? and carmodel9_.year=?) and carmodel9_.id = ? and (carmaker10_.amount=? and carmaker10_.currency=? and carmaker10_.name=?) and carmaker10_.code = ? and (carmodel11_.name=? and carmodel11_.year=?) and carmodel11_.id = ? and (carmaker12_.amount=? and carmaker12_.currency=? and carmaker12_.name=?) and carmaker12_.code = ? and (owner13_1_.birthDate=? and owner13_1_.familyName=? and owner13_1_.givenName=?) and owner13_.id = ? and (address14_.city=? and address14_.county=? and address14_.no=? and address14_.street=? and address14_.zipCode=?) and address14_.id = ? and (address15_.city=? and address15_.county=? and address15_.no=? and address15_.street=? and address15_.zipCode=?) and address15_.id = ? and (car16_.amount=? and car16_.currency=? and car16_.registrationDate=?) and car16_.id = ? and (carmodel17_.name=? and carmodel17_.year=?) and carmodel17_.id = ? and (carmaker18_.amount=? and carmaker18_.currency=? and carmaker18_.name=?) and carmaker18_.code = ? and (carmodel19_.name=? and carmodel19_.year=?) and carmodel19_.id = ? and (carmaker20_.amount=? and carmaker20_.currency=? and carmaker20_.name=?) and carmaker20_.code = ? and (sticker21_.height=? and sticker21_.name=? and sticker21_.width=?) and sticker21_.id = ? and (sticker22_.height=? and sticker22_.name=? and sticker22_.width=?) and sticker22_.id = ? limit ? TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 5 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 7 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 8 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 9 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 10 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 11 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 12 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 13 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 14 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 15 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 16 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 17 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 18 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 19 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 20 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 21 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 22 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 23 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 24 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 25 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 26 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 27 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 28 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 29 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 30 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 31 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 32 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 33 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 34 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 35 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 36 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 37 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 38 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 39 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 40 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 41 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 42 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 43 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 44 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 45 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 46 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 47 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 48 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 49 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 50 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 51 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 52 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 53 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 54 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 55 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 56 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 57 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 58 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 59 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 60 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 61 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 62 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 63 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 64 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 65 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 66 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 67 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 68 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 69 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 70 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 71 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 72 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 73 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 74 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 75 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 76 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 77 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 78 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 79 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 80 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 81 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 82 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 83 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 84 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 85 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 86 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 87 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 88 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 89 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 90 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 91 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 92 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 93 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 94 TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_0_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_1_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_2_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_3_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_4_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_5_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_6_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_7_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_8_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_9_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_10_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_11_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_12_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_13_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_14_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_15_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_16_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_17_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_18_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_19_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_20_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_21_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_22_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_23_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_24_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_25_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@11e7cc6 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testOneToMany@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (12): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1c66ec7]; rollback [true] Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Smalltown' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'MI' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '15' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Long road' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '14352' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1970-03-07 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'McBeal' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Alice' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: select person0_.id as id4_3_, person0_.birthDate as birthDate4_3_, person0_.currentAddress_id as currentA6_4_3_, person0_.fiscalAddress_id as fiscalAd7_4_3_, person0_.familyName as familyName4_3_, person0_.givenName as givenName4_3_, person0_.title as title4_3_, person0_1_.department as department5_3_, person0_1_.employedSince as employed2_5_3_, person0_1_.employer_code as employer7_5_3_, person0_1_.amount as amount5_3_, person0_1_.currency as currency5_3_, person0_1_.qualification as qualific5_5_3_, person0_2_.hipsterFactor as hipsterF1_6_3_, case when person0_2_.id is not null then 2 when person0_1_.id is not null then 1 when person0_3_.id is not null then 3 when person0_.id is not null then 0 end as clazz_3_, address1_.id as id0_0_, address1_.city as city0_0_, address1_.county as county0_0_, address1_.no as no0_0_, address1_.street as street0_0_, address1_.zipCode as zipCode0_0_, address2_.id as id0_1_, address2_.city as city0_1_, address2_.county as county0_1_, address2_.no as no0_1_, address2_.street as street0_1_, address2_.zipCode as zipCode0_1_, carmaker3_.code as code2_2_, carmaker3_.amount as amount2_2_, carmaker3_.currency as currency2_2_, carmaker3_.name as name2_2_ from Person person0_ left outer join Employee person0_1_ on person0_.id=person0_1_.id left outer join Designer person0_2_ on person0_.id=person0_2_.id left outer join Owner person0_3_ on person0_.id=person0_3_.id inner join Address address1_ on person0_.currentAddress_id=address1_.id left outer join Address address2_ on person0_.fiscalAddress_id=address2_.id left outer join CarMaker carmaker3_ on person0_1_.employer_code=carmaker3_.code where person0_.id=? TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_1_ TRACE - NullableType.nullSafeGet(189) | returning null as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning 'Smalltown' as column: city0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'MI' as column: county0_0_ TRACE - NullableType.nullSafeGet(195) | returning '15' as column: no0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'Long road' as column: street0_0_ TRACE - NullableType.nullSafeGet(195) | returning '14352' as column: zipCode0_0_ TRACE - NullableType.nullSafeGet(195) | returning '0' as column: clazz_3_ TRACE - NullableType.nullSafeGet(195) | returning '1970-03-07 00:00:00' as column: birthDate4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: currentA6_4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: fiscalAd7_4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'McBeal' as column: familyName4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'Alice' as column: givenName4_3_ DEBUG - EnumType.nullSafeGet(103) | Returning null as column title4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@11e7cc6 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveBasic@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (13): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1c66ec7]; rollback [true] Hibernate: insert into CarMaker (amount, currency, name, code) values (?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 4 Hibernate: insert into CarModel (id, make_code, name, year) values (default, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 3 Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Nagato' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'TK' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '6' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Khan avenue' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '99867' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Shiro' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Ken' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: insert into Employee (department, employedSince, employer_code, amount, currency, qualification, id) values (?, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'design' to parameter: 1 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '60000.0' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 5 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 7 Hibernate: insert into Designer (hipsterFactor, id) values (?, ?) TRACE - NullableType.nullSafeSet(153) | binding '97' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 Hibernate: select this_.id as id4_3_, this_.birthDate as birthDate4_3_, this_.currentAddress_id as currentA6_4_3_, this_.fiscalAddress_id as fiscalAd7_4_3_, this_.familyName as familyName4_3_, this_.givenName as givenName4_3_, this_.title as title4_3_, this_1_.department as department5_3_, this_1_.employedSince as employed2_5_3_, this_1_.employer_code as employer7_5_3_, this_1_.amount as amount5_3_, this_1_.currency as currency5_3_, this_1_.qualification as qualific5_5_3_, this_2_.hipsterFactor as hipsterF1_6_3_, case when this_2_.id is not null then 2 when this_1_.id is not null then 1 when this_3_.id is not null then 3 when this_.id is not null then 0 end as clazz_3_, address2_.id as id0_0_, address2_.city as city0_0_, address2_.county as county0_0_, address2_.no as no0_0_, address2_.street as street0_0_, address2_.zipCode as zipCode0_0_, address3_.id as id0_1_, address3_.city as city0_1_, address3_.county as county0_1_, address3_.no as no0_1_, address3_.street as street0_1_, address3_.zipCode as zipCode0_1_, carmaker4_.code as code2_2_, carmaker4_.amount as amount2_2_, carmaker4_.currency as currency2_2_, carmaker4_.name as name2_2_ from Person this_ left outer join Employee this_1_ on this_.id=this_1_.id left outer join Designer this_2_ on this_.id=this_2_.id left outer join Owner this_3_ on this_.id=this_3_.id inner join Address address2_ on this_.currentAddress_id=address2_.id left outer join Address address3_ on this_.fiscalAddress_id=address3_.id left outer join CarMaker carmaker4_ on this_1_.employer_code=carmaker4_.code where (this_.birthDate=?) limit ? TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_1_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@11e7cc6 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveWithCascade@HibernateDAOPersistenceTest, testException = [null]]] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.411 sec Results : Tests run: 18, Failures: 0, Errors: 0, Skipped: 0 INFO - AbstractApplicationContext.doClose(938) | Closing org.springframework.context.support.GenericApplicationContext@50ca0c: startup date [Fri Jun 29 17:39:28 CEST 2012]; root of context hierarchy INFO - DefaultSingletonBeanRegistry.destroySingletons(421) | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d2b9b7: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,carDAO,carMakerDAO,personDAO,stickerDAO,dataSource,sessionFactory,transactionManager]; root of factory hierarchy INFO - AbstractSessionFactoryBean.destroy(246) | Closing Hibernate SessionFactory INFO - SessionFactoryImpl.close(940) | closing INFO - SchemaExport.execute(226) | Running hbm2ddl schema export INFO - SchemaExport.execute(251) | exporting generated schema to database INFO - SchemaExport.execute(268) | schema export complete [JENKINS] Recording test results [INFO] [bundle:bundle {execution: default-bundle}] [INFO] Preparing source:jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [INFO] No goals needed for project - skipping [INFO] [source:jar {execution: attach-sources}] [INFO] Building jar: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> [INFO] [assembly:single {execution: bundle}] [INFO] Reading assembly descriptor: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/src/main/assembly/assembly-bundle.xml> [INFO] Building zip: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT-bundle.zip> [INFO] [license:check {execution: default}] [INFO] Checking licenses... [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java> [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java> [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/src/test/java/it/openutils/hibernate/test/EntityBuilder.java> [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/pom.xml> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_17-39-11/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/pom.xml [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_17-39-11/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT.jar [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_17-39-11/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Some files do not have the expected license header [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 24 seconds [INFO] Finished at: Fri Jun 29 17:39:40 CEST 2012 [INFO] Final Memory: 52M/293M [INFO] ------------------------------------------------------------------------ |
From: <gca...@us...> - 2012-06-29 16:03:15
|
Revision: 4077 http://openutils.svn.sourceforge.net/openutils/?rev=4077&view=rev Author: gcatania Date: 2012-06-29 16:03:05 +0000 (Fri, 29 Jun 2012) Log Message: ----------- BSHD-2 adding tests for filter metadata, refactoring Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java Added Paths: ----------- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 15:10:22 UTC (rev 4076) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-06-29 16:03:05 UTC (rev 4077) @@ -38,7 +38,6 @@ import org.aopalliance.aop.AspectException; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.Hibernate; @@ -166,7 +165,7 @@ */ public List<T> find(String query, Object paramValue, Type paramType) { - return getThis().find(query, new Object[]{paramValue }, new Type[]{paramType }); + return getThis().find(query, new Object[]{paramValue}, new Type[]{paramType}); } /** @@ -723,7 +722,7 @@ * @author gcatania */ @SuppressWarnings("deprecation") - private class LegacySupportCallback<R> extends ExampleTreeCallback<R> + private class LegacySupportCallback<R> extends BaseCallback<R> { private final T rootEntity; @@ -740,7 +739,7 @@ List< ? extends Criterion> additionalCriteria, Order... orders) { - super(new ExampleTree(rootEntity), maxResults, page, orders); + super(maxResults, page, orders); this.rootEntity = rootEntity; this.filterMetadata = metadata; this.additionalCriteria = additionalCriteria; @@ -749,11 +748,7 @@ @Override protected Criteria createCriteria(Session session) { - Criteria crit = super.createCriteria(session); - if (MapUtils.isNotEmpty(filterMetadata)) - { - new FilterMetadataSupport(rootEntity, filterMetadata).appendTo(crit, session); - } + Criteria crit = new FilterMetadataSupport(rootEntity, filterMetadata).create(session); if (additionalCriteria != null) { for (Criterion c : additionalCriteria) @@ -793,8 +788,12 @@ protected Criteria createCriteria(Session session) { Criteria crit = super.createCriteria(session); - if (!CollectionUtils.isEmpty(properties)) + if (CollectionUtils.isEmpty(properties)) { + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + } + else + { ProjectionList projectionList = Projections.projectionList(); for (String property : properties) { @@ -813,7 +812,7 @@ * @author gcatania * @param R the result class */ -class ExampleTreeCallback<R> implements HibernateCallback<List<R>> +abstract class BaseCallback<R> implements HibernateCallback<List<R>> { private final Order[] orders; @@ -822,26 +821,23 @@ private final int page; - private final ExampleTree exampleTree; - - protected ExampleTreeCallback(ExampleTree exampleTree, int maxResults, int page, Order... orders) + protected BaseCallback(int maxResults, int page, Order... orders) { - this.exampleTree = exampleTree; this.maxResults = maxResults; this.page = page; this.orders = orders; } /** - * internal method that creates the query criteria. Subclasses may override but should call {@code super()} + * internal method that creates the query criteria. * @param session the hibernate session * @return the hibernate criteria */ - protected Criteria createCriteria(Session session) + protected abstract Criteria createCriteria(Session session); + + public final List<R> doInHibernate(Session session) throws HibernateException, SQLException { - Criteria crit = exampleTree.create(session); - - crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + Criteria crit = createCriteria(session); crit.setMaxResults(maxResults); crit.setFirstResult(maxResults * page); if (orders != null) @@ -851,13 +847,35 @@ crit.addOrder(o); } } + return crit.list(); + } +} - return crit; + +/** + * @author gcatania + * @param R the result class + */ +class ExampleTreeCallback<R> extends BaseCallback<R> +{ + + private final ExampleTree exampleTree; + + protected ExampleTreeCallback(ExampleTree exampleTree, int maxResults, int page, Order... orders) + { + super(maxResults, page, orders); + this.exampleTree = exampleTree; } - public List<R> doInHibernate(Session session) throws HibernateException, SQLException + /** + * internal method that creates the query criteria. Subclasses may override. + * @param session the hibernate session + * @return the hibernate criteria + */ + @Override + protected Criteria createCriteria(Session session) { - return createCriteria(session).list(); + return exampleTree.create(session); } } @@ -867,9 +885,12 @@ private final List<String> properties; - protected ExampleTreePropertiesCallback(ExampleTree exampleTree, int maxResults, int page, - - List<String> properties, Order... orders) + protected ExampleTreePropertiesCallback( + ExampleTree exampleTree, + int maxResults, + int page, + List<String> properties, + Order... orders) { super(exampleTree, maxResults, page, orders); this.properties = properties; @@ -879,8 +900,12 @@ protected Criteria createCriteria(Session session) { Criteria crit = super.createCriteria(session); - if (!CollectionUtils.isEmpty(properties)) + if (CollectionUtils.isEmpty(properties)) { + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + } + else + { ProjectionList projectionList = Projections.projectionList(); for (String property : properties) { Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 15:10:22 UTC (rev 4076) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 16:03:05 UTC (rev 4077) @@ -172,10 +172,12 @@ { continue; } - String leftover = key.substring(path.length() + 1); - // skip subproperties + // need to take into account leading dot for subproperties + int trimLength = path.isEmpty() ? 0 : path.length() + 1; + String leftover = key.substring(trimLength); if (leftover.contains(".")) { + // skip subproperties continue; } result.put(leftover, filterMetadata.get(key)); Modified: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java 2012-06-29 15:10:22 UTC (rev 4076) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java 2012-06-29 16:03:05 UTC (rev 4077) @@ -105,6 +105,11 @@ return prius; } + public static CarModel prius() + { + return prius(toyota()); + } + public static Designer priusDesigner(CarModel prius) { FullName fullName = new FullName("Ken", "Shiro"); @@ -134,6 +139,11 @@ return bobsPrius; } + public static Car bobsPrius() + { + return bobsPrius(bob(), prius()); + } + public static Car chucksPrius(Owner chuck, CarModel prius) { Car chucksPrius = new Car(); Added: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java (rev 0) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java 2012-06-29 16:03:05 UTC (rev 4077) @@ -0,0 +1,155 @@ +/** + * + * openutils base Spring-Hibernate DAO (http://www.openmindlab.com/lab/products/bshd5.html) + * + * Copyright(C) 2005-2012, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package it.openutils.hibernate.test; + +import static it.openutils.hibernate.test.EntityBuilder.bobsPrius; +import static it.openutils.hibernate.test.EntityBuilder.chuck; +import static it.openutils.hibernate.test.EntityBuilder.chucksPrius; +import static it.openutils.hibernate.test.EntityBuilder.prius; +import static it.openutils.hibernate.test.EntityBuilder.toyota; +import it.openutils.hibernate.example.FilterMetadata; +import it.openutils.hibernate.test.dao.CarDAO; +import it.openutils.hibernate.test.dao.CarMakerDAO; +import it.openutils.hibernate.test.dao.PersonDAO; +import it.openutils.hibernate.test.dao.StickerDAO; +import it.openutils.hibernate.test.model.Car; +import it.openutils.hibernate.test.model.Sticker; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; +import org.testng.Assert; +import org.testng.annotations.Test; + + +/** + * @author gcatania + */ +@SuppressWarnings("deprecation") +@ContextConfiguration(locations = "/spring-tests.xml") +public class HibernateDAOFilterMetadataTest extends AbstractTransactionalTestNGSpringContextTests +{ + + @Autowired + private PersonDAO personDAO; + + @Autowired + private CarMakerDAO carMakerDAO; + + @Autowired + private CarDAO carDAO; + + @Autowired + private StickerDAO stickerDAO; + + @Test + public void testFindFilterMetadataBasic() + { + Sticker st1 = new Sticker(); + st1.setName("Warning! Baby on board!"); + st1.setHeight(20d); + st1.setWidth(10d); + Sticker st2 = new Sticker(); + st2.setName("Objects in the mirror are losing"); + st2.setHeight(5d); + st2.setWidth(10d); + Sticker st3 = new Sticker(); + st3.setName("(tribal tattoo sticker)"); + st3.setHeight(35d); + st3.setWidth(18d); + + Car chucksPrius = chucksPrius(chuck(), prius(toyota())); + chucksPrius.setStickers(Arrays.asList(st1, st2, st3)); + carDAO.save(chucksPrius); + carDAO.evict(chucksPrius); + + FilterMetadata fm = new FilterMetadata() + { + + public void createFilter(Criteria criteria, String propertyName, Object propertyValue) + { + criteria.add(Restrictions.gt(propertyName, 18d)); + criteria.add(Restrictions.lt(propertyName, 22d)); + } + }; + List<Sticker> found = stickerDAO.findFiltered(new Sticker(), Collections.singletonMap("height", fm)); + Assert.assertEquals(found.size(), 1); + Assert.assertEquals(found.get(0), st1); + } + + @Test + public void testFindFilterMetadataOnChildProperty() + { + Sticker st1 = new Sticker(); + st1.setName("Warning! Baby on board!"); + st1.setHeight(20d); + st1.setWidth(10d); + Sticker st2 = new Sticker(); + st2.setName("Objects in the mirror are losing"); + st2.setHeight(5d); + st2.setWidth(10d); + Sticker st3 = new Sticker(); + st3.setName("(tribal tattoo sticker)"); + st3.setHeight(35d); + st3.setWidth(18d); + + Car chucksPrius = chucksPrius(chuck(), prius(toyota())); + chucksPrius.setStickers(Arrays.asList(st1, st2, st3)); + + Car bobsPrius = bobsPrius(); + bobsPrius.setStickers(Arrays.asList(st2.clone())); + + carDAO.save(chucksPrius); + carDAO.evict(chucksPrius); + carDAO.save(bobsPrius); + carDAO.evict(bobsPrius); + + FilterMetadata fm = new FilterMetadata() + { + + public void createFilter(Criteria criteria, String propertyName, Object propertyValue) + { + criteria.add(Restrictions.gt(propertyName, 18d)); + criteria.add(Restrictions.lt(propertyName, 22d)); + } + }; + Car filter = new Car(); + filter.setStickers(Collections.singletonList(new Sticker())); + List<Car> found = carDAO.findFiltered(filter, Collections.singletonMap("stickers.height", fm)); + Assert.assertEquals(found.size(), 1); + Car actual = found.get(0); + Assert.assertEquals(actual.getStickers().size(), 3); + // full fledged equality fails because of Object.equals() on PersistentBag + Assert.assertEquals(actual.getOwner().getName(), chucksPrius.getOwner().getName()); + } + +} Property changes on: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOFilterMetadataTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2012-06-29 15:18:48
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/67/changes> Changes: [gcatania] cleanup unit tests ------------------------------------------ [...truncated 663 lines...] TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 5 Hibernate: insert into Sticker (id, height, name, width, carId) values (default, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 Hibernate: update Sticker set carId=? where id=? TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 2 Hibernate: select this_.id as id1_25_, this_.amount as amount1_25_, this_.currency as currency1_25_, this_.model_id as model5_1_25_, this_.owner_id as owner6_1_25_, this_.registrationDate as registra4_1_25_, carmodel1_.id as id3_0_, carmodel1_.make_code as make4_3_0_, carmodel1_.name as name3_0_, carmodel1_.year as year3_0_, carmaker2_.code as code2_1_, carmaker2_.amount as amount2_1_, carmaker2_.currency as currency2_1_, carmaker2_.name as name2_1_, carmodel3_.id as id3_2_, carmodel3_.make_code as make4_3_2_, carmodel3_.name as name3_2_, carmodel3_.year as year3_2_, carmaker4_.code as code2_3_, carmaker4_.amount as amount2_3_, carmaker4_.currency as currency2_3_, carmaker4_.name as name2_3_, owner5_.id as id4_4_, owner5_1_.birthDate as birthDate4_4_, owner5_1_.currentAddress_id as currentA6_4_4_, owner5_1_.fiscalAddress_id as fiscalAd7_4_4_, owner5_1_.familyName as familyName4_4_, owner5_1_.givenName as givenName4_4_, owner5_1_.title as title4_4_, address6_.id as id0_5_, address6_.city as city0_5_, address6_.county as county0_5_, address6_.no as no0_5_, address6_.street as street0_5_, address6_.zipCode as zipCode0_5_, address7_.id as id0_6_, address7_.city as city0_6_, address7_.county as county0_6_, address7_.no as no0_6_, address7_.street as street0_6_, address7_.zipCode as zipCode0_6_, car8_.id as id1_7_, car8_.amount as amount1_7_, car8_.currency as currency1_7_, car8_.model_id as model5_1_7_, car8_.owner_id as owner6_1_7_, car8_.registrationDate as registra4_1_7_, carmodel9_.id as id3_8_, carmodel9_.make_code as make4_3_8_, carmodel9_.name as name3_8_, carmodel9_.year as year3_8_, carmaker10_.code as code2_9_, carmaker10_.amount as amount2_9_, carmaker10_.currency as currency2_9_, carmaker10_.name as name2_9_, carmodel11_.id as id3_10_, carmodel11_.make_code as make4_3_10_, carmodel11_.name as name3_10_, carmodel11_.year as year3_10_, carmaker12_.code as code2_11_, carmaker12_.amount as amount2_11_, carmaker12_.currency as currency2_11_, carmaker12_.name as name2_11_, owner13_.id as id4_12_, owner13_1_.birthDate as birthDate4_12_, owner13_1_.currentAddress_id as currentA6_4_12_, owner13_1_.fiscalAddress_id as fiscalAd7_4_12_, owner13_1_.familyName as familyName4_12_, owner13_1_.givenName as givenName4_12_, owner13_1_.title as title4_12_, address14_.id as id0_13_, address14_.city as city0_13_, address14_.county as county0_13_, address14_.no as no0_13_, address14_.street as street0_13_, address14_.zipCode as zipCode0_13_, address15_.id as id0_14_, address15_.city as city0_14_, address15_.county as county0_14_, address15_.no as no0_14_, address15_.street as street0_14_, address15_.zipCode as zipCode0_14_, car16_.id as id1_15_, car16_.amount as amount1_15_, car16_.currency as currency1_15_, car16_.model_id as model5_1_15_, car16_.owner_id as owner6_1_15_, car16_.registrationDate as registra4_1_15_, carmodel17_.id as id3_16_, carmodel17_.make_code as make4_3_16_, carmodel17_.name as name3_16_, carmodel17_.year as year3_16_, carmaker18_.code as code2_17_, carmaker18_.amount as amount2_17_, carmaker18_.currency as currency2_17_, carmaker18_.name as name2_17_, carmodel19_.id as id3_18_, carmodel19_.make_code as make4_3_18_, carmodel19_.name as name3_18_, carmodel19_.year as year3_18_, carmaker20_.code as code2_19_, carmaker20_.amount as amount2_19_, carmaker20_.currency as currency2_19_, carmaker20_.name as name2_19_, owner44_.id as id4_20_, owner44_1_.birthDate as birthDate4_20_, owner44_1_.currentAddress_id as currentA6_4_20_, owner44_1_.fiscalAddress_id as fiscalAd7_4_20_, owner44_1_.familyName as familyName4_20_, owner44_1_.givenName as givenName4_20_, owner44_1_.title as title4_20_, address45_.id as id0_21_, address45_.city as city0_21_, address45_.county as county0_21_, address45_.no as no0_21_, address45_.street as street0_21_, address45_.zipCode as zipCode0_21_, address46_.id as id0_22_, address46_.city as city0_22_, address46_.county as county0_22_, address46_.no as no0_22_, address46_.street as street0_22_, address46_.zipCode as zipCode0_22_, sticker21_.id as id8_23_, sticker21_.height as height8_23_, sticker21_.name as name8_23_, sticker21_.width as width8_23_, sticker22_.id as id8_24_, sticker22_.height as height8_24_, sticker22_.name as name8_24_, sticker22_.width as width8_24_ from Car this_ inner join CarModel carmodel1_ on this_.model_id=carmodel1_.id inner join CarMaker carmaker2_ on carmodel1_.make_code=carmaker2_.code inner join CarModel carmodel3_ on carmaker2_.code=carmodel3_.make_code inner join CarMaker carmaker4_ on carmodel3_.make_code=carmaker4_.code inner join Owner owner5_ on this_.owner_id=owner5_.id left outer join Person owner5_1_ on owner5_.id=owner5_1_.id inner join Address address6_ on owner5_1_.currentAddress_id=address6_.id inner join Address address7_ on owner5_1_.fiscalAddress_id=address7_.id inner join Car car8_ on owner5_.id=car8_.owner_id inner join CarModel carmodel9_ on car8_.model_id=carmodel9_.id inner join CarMaker carmaker10_ on carmodel9_.make_code=carmaker10_.code inner join CarModel carmodel11_ on carmaker10_.code=carmodel11_.make_code inner join CarMaker carmaker12_ on carmodel11_.make_code=carmaker12_.code inner join Owner owner13_ on car8_.owner_id=owner13_.id left outer join Person owner13_1_ on owner13_.id=owner13_1_.id inner join Address address14_ on owner13_1_.currentAddress_id=address14_.id inner join Address address15_ on owner13_1_.fiscalAddress_id=address15_.id inner join Car car16_ on owner13_.id=car16_.owner_id inner join CarModel carmodel17_ on car16_.model_id=carmodel17_.id inner join CarMaker carmaker18_ on carmodel17_.make_code=carmaker18_.code inner join CarModel carmodel19_ on carmaker18_.code=carmodel19_.make_code inner join CarMaker carmaker20_ on carmodel19_.make_code=carmaker20_.code left outer join Owner owner44_ on car16_.owner_id=owner44_.id left outer join Person owner44_1_ on owner44_.id=owner44_1_.id left outer join Address address45_ on owner44_1_.currentAddress_id=address45_.id left outer join Address address46_ on owner44_1_.fiscalAddress_id=address46_.id inner join Sticker sticker21_ on car16_.id=sticker21_.carId inner join Sticker sticker22_ on car8_.id=sticker22_.carId where (this_.amount=? and this_.currency=? and this_.registrationDate=?) and this_.id = ? and (carmodel1_.name=? and carmodel1_.year=?) and carmodel1_.id = ? and (carmaker2_.amount=? and carmaker2_.currency=? and carmaker2_.name=?) and carmaker2_.code = ? and (carmodel3_.name=? and carmodel3_.year=?) and carmodel3_.id = ? and (carmaker4_.amount=? and carmaker4_.currency=? and carmaker4_.name=?) and carmaker4_.code = ? and (owner5_1_.birthDate=? and owner5_1_.familyName=? and owner5_1_.givenName=?) and owner5_.id = ? and (address6_.city=? and address6_.county=? and address6_.no=? and address6_.street=? and address6_.zipCode=?) and address6_.id = ? and (address7_.city=? and address7_.county=? and address7_.no=? and address7_.street=? and address7_.zipCode=?) and address7_.id = ? and (car8_.amount=? and car8_.currency=? and car8_.registrationDate=?) and car8_.id = ? and (carmodel9_.name=? and carmodel9_.year=?) and carmodel9_.id = ? and (carmaker10_.amount=? and carmaker10_.currency=? and carmaker10_.name=?) and carmaker10_.code = ? and (carmodel11_.name=? and carmodel11_.year=?) and carmodel11_.id = ? and (carmaker12_.amount=? and carmaker12_.currency=? and carmaker12_.name=?) and carmaker12_.code = ? and (owner13_1_.birthDate=? and owner13_1_.familyName=? and owner13_1_.givenName=?) and owner13_.id = ? and (address14_.city=? and address14_.county=? and address14_.no=? and address14_.street=? and address14_.zipCode=?) and address14_.id = ? and (address15_.city=? and address15_.county=? and address15_.no=? and address15_.street=? and address15_.zipCode=?) and address15_.id = ? and (car16_.amount=? and car16_.currency=? and car16_.registrationDate=?) and car16_.id = ? and (carmodel17_.name=? and carmodel17_.year=?) and carmodel17_.id = ? and (carmaker18_.amount=? and carmaker18_.currency=? and carmaker18_.name=?) and carmaker18_.code = ? and (carmodel19_.name=? and carmodel19_.year=?) and carmodel19_.id = ? and (carmaker20_.amount=? and carmaker20_.currency=? and carmaker20_.name=?) and carmaker20_.code = ? and (sticker21_.height=? and sticker21_.name=? and sticker21_.width=?) and sticker21_.id = ? and (sticker22_.height=? and sticker22_.name=? and sticker22_.width=?) and sticker22_.id = ? limit ? TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 5 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 7 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 8 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 9 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 10 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 11 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 12 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 13 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 14 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 15 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 16 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 17 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 18 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 19 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 20 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 21 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 22 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 23 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 24 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 25 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 26 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 27 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 28 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 29 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 30 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 31 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 32 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 33 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 34 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 35 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 36 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 37 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 38 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 39 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 40 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 41 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 42 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 43 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 44 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 45 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 46 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 47 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 48 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 49 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 50 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 51 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 52 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 53 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 54 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 55 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 56 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 57 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 58 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 59 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 60 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 61 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 62 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 63 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 64 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 65 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 66 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 67 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 68 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 69 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 70 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 71 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 72 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 73 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 74 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 75 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 76 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 77 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 78 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 79 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 80 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 81 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 82 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 83 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 84 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 85 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 86 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 87 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 88 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 89 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 90 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 91 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 92 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 93 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 94 TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_0_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_1_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_2_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_3_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_4_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_5_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_6_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_7_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_8_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_9_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_10_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_11_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_12_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_13_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_14_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_15_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_16_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_17_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_18_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_19_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_20_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_21_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_22_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_23_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_24_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_25_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@91e321 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testOneToMany@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (12): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1a4ea4f]; rollback [true] Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Smalltown' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'MI' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '15' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Long road' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '14352' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1970-03-07 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'McBeal' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Alice' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: select person0_.id as id4_3_, person0_.birthDate as birthDate4_3_, person0_.currentAddress_id as currentA6_4_3_, person0_.fiscalAddress_id as fiscalAd7_4_3_, person0_.familyName as familyName4_3_, person0_.givenName as givenName4_3_, person0_.title as title4_3_, person0_1_.department as department5_3_, person0_1_.employedSince as employed2_5_3_, person0_1_.employer_code as employer7_5_3_, person0_1_.amount as amount5_3_, person0_1_.currency as currency5_3_, person0_1_.qualification as qualific5_5_3_, person0_2_.hipsterFactor as hipsterF1_6_3_, case when person0_2_.id is not null then 2 when person0_1_.id is not null then 1 when person0_3_.id is not null then 3 when person0_.id is not null then 0 end as clazz_3_, address1_.id as id0_0_, address1_.city as city0_0_, address1_.county as county0_0_, address1_.no as no0_0_, address1_.street as street0_0_, address1_.zipCode as zipCode0_0_, address2_.id as id0_1_, address2_.city as city0_1_, address2_.county as county0_1_, address2_.no as no0_1_, address2_.street as street0_1_, address2_.zipCode as zipCode0_1_, carmaker3_.code as code2_2_, carmaker3_.amount as amount2_2_, carmaker3_.currency as currency2_2_, carmaker3_.name as name2_2_ from Person person0_ left outer join Employee person0_1_ on person0_.id=person0_1_.id left outer join Designer person0_2_ on person0_.id=person0_2_.id left outer join Owner person0_3_ on person0_.id=person0_3_.id inner join Address address1_ on person0_.currentAddress_id=address1_.id left outer join Address address2_ on person0_.fiscalAddress_id=address2_.id left outer join CarMaker carmaker3_ on person0_1_.employer_code=carmaker3_.code where person0_.id=? TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_1_ TRACE - NullableType.nullSafeGet(189) | returning null as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning 'Smalltown' as column: city0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'MI' as column: county0_0_ TRACE - NullableType.nullSafeGet(195) | returning '15' as column: no0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'Long road' as column: street0_0_ TRACE - NullableType.nullSafeGet(195) | returning '14352' as column: zipCode0_0_ TRACE - NullableType.nullSafeGet(195) | returning '0' as column: clazz_3_ TRACE - NullableType.nullSafeGet(195) | returning '1970-03-07 00:00:00' as column: birthDate4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: currentA6_4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: fiscalAd7_4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'McBeal' as column: familyName4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'Alice' as column: givenName4_3_ DEBUG - EnumType.nullSafeGet(103) | Returning null as column title4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@91e321 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveBasic@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (13): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1a4ea4f]; rollback [true] Hibernate: insert into CarMaker (amount, currency, name, code) values (?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 4 Hibernate: insert into CarModel (id, make_code, name, year) values (default, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 3 Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Nagato' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'TK' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '6' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Khan avenue' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '99867' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Shiro' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Ken' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: insert into Employee (department, employedSince, employer_code, amount, currency, qualification, id) values (?, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'design' to parameter: 1 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '60000.0' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 5 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 7 Hibernate: insert into Designer (hipsterFactor, id) values (?, ?) TRACE - NullableType.nullSafeSet(153) | binding '97' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 Hibernate: select this_.id as id4_3_, this_.birthDate as birthDate4_3_, this_.currentAddress_id as currentA6_4_3_, this_.fiscalAddress_id as fiscalAd7_4_3_, this_.familyName as familyName4_3_, this_.givenName as givenName4_3_, this_.title as title4_3_, this_1_.department as department5_3_, this_1_.employedSince as employed2_5_3_, this_1_.employer_code as employer7_5_3_, this_1_.amount as amount5_3_, this_1_.currency as currency5_3_, this_1_.qualification as qualific5_5_3_, this_2_.hipsterFactor as hipsterF1_6_3_, case when this_2_.id is not null then 2 when this_1_.id is not null then 1 when this_3_.id is not null then 3 when this_.id is not null then 0 end as clazz_3_, address2_.id as id0_0_, address2_.city as city0_0_, address2_.county as county0_0_, address2_.no as no0_0_, address2_.street as street0_0_, address2_.zipCode as zipCode0_0_, address3_.id as id0_1_, address3_.city as city0_1_, address3_.county as county0_1_, address3_.no as no0_1_, address3_.street as street0_1_, address3_.zipCode as zipCode0_1_, carmaker4_.code as code2_2_, carmaker4_.amount as amount2_2_, carmaker4_.currency as currency2_2_, carmaker4_.name as name2_2_ from Person this_ left outer join Employee this_1_ on this_.id=this_1_.id left outer join Designer this_2_ on this_.id=this_2_.id left outer join Owner this_3_ on this_.id=this_3_.id inner join Address address2_ on this_.currentAddress_id=address2_.id left outer join Address address3_ on this_.fiscalAddress_id=address3_.id left outer join CarMaker carmaker4_ on this_1_.employer_code=carmaker4_.code where (this_.birthDate=?) limit ? TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_1_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@91e321 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveWithCascade@HibernateDAOPersistenceTest, testException = [null]]] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.216 sec Results : Tests run: 18, Failures: 0, Errors: 0, Skipped: 0 INFO - AbstractApplicationContext.doClose(938) | Closing org.springframework.context.support.GenericApplicationContext@50ca0c: startup date [Fri Jun 29 16:50:20 CEST 2012]; root of context hierarchy INFO - DefaultSingletonBeanRegistry.destroySingletons(421) | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@19ecd80: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,carDAO,carMakerDAO,personDAO,stickerDAO,dataSource,sessionFactory,transactionManager]; root of factory hierarchy INFO - AbstractSessionFactoryBean.destroy(246) | Closing Hibernate SessionFactory INFO - SessionFactoryImpl.close(940) | closing INFO - SchemaExport.execute(226) | Running hbm2ddl schema export INFO - SchemaExport.execute(251) | exporting generated schema to database INFO - SchemaExport.execute(268) | schema export complete [JENKINS] Recording test results [INFO] [bundle:bundle {execution: default-bundle}] [INFO] Preparing source:jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [INFO] No goals needed for project - skipping [INFO] [source:jar {execution: attach-sources}] [INFO] Building jar: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> [INFO] [assembly:single {execution: bundle}] [INFO] Reading assembly descriptor: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/src/main/assembly/assembly-bundle.xml> [INFO] Building zip: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT-bundle.zip> [INFO] [license:check {execution: default}] [INFO] Checking licenses... [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java> [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/pom.xml> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_16-50-03/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/pom.xml [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_16-50-03/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT.jar [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/ws/openutils-bshd5/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_16-50-03/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Some files do not have the expected license header [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23 seconds [INFO] Finished at: Fri Jun 29 16:50:31 CEST 2012 [INFO] Final Memory: 52M/293M [INFO] ------------------------------------------------------------------------ Sending e-mails to: ope...@li... channel stopped |
From: <hu...@op...> - 2012-06-29 15:16:40
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/67/changes> Changes: [gcatania] cleanup unit tests ------------------------------------------ [...truncated 652 lines...] Hibernate: insert into Car (id, amount, currency, model_id, owner_id, registrationDate) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 5 Hibernate: insert into Sticker (id, height, name, width, carId) values (default, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 Hibernate: update Sticker set carId=? where id=? TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 2 Hibernate: select this_.id as id1_25_, this_.amount as amount1_25_, this_.currency as currency1_25_, this_.model_id as model5_1_25_, this_.owner_id as owner6_1_25_, this_.registrationDate as registra4_1_25_, carmodel1_.id as id3_0_, carmodel1_.make_code as make4_3_0_, carmodel1_.name as name3_0_, carmodel1_.year as year3_0_, carmaker2_.code as code2_1_, carmaker2_.amount as amount2_1_, carmaker2_.currency as currency2_1_, carmaker2_.name as name2_1_, carmodel3_.id as id3_2_, carmodel3_.make_code as make4_3_2_, carmodel3_.name as name3_2_, carmodel3_.year as year3_2_, carmaker4_.code as code2_3_, carmaker4_.amount as amount2_3_, carmaker4_.currency as currency2_3_, carmaker4_.name as name2_3_, owner5_.id as id4_4_, owner5_1_.birthDate as birthDate4_4_, owner5_1_.currentAddress_id as currentA6_4_4_, owner5_1_.fiscalAddress_id as fiscalAd7_4_4_, owner5_1_.familyName as familyName4_4_, owner5_1_.givenName as givenName4_4_, owner5_1_.title as title4_4_, address6_.id as id0_5_, address6_.city as city0_5_, address6_.county as county0_5_, address6_.no as no0_5_, address6_.street as street0_5_, address6_.zipCode as zipCode0_5_, address7_.id as id0_6_, address7_.city as city0_6_, address7_.county as county0_6_, address7_.no as no0_6_, address7_.street as street0_6_, address7_.zipCode as zipCode0_6_, car8_.id as id1_7_, car8_.amount as amount1_7_, car8_.currency as currency1_7_, car8_.model_id as model5_1_7_, car8_.owner_id as owner6_1_7_, car8_.registrationDate as registra4_1_7_, carmodel9_.id as id3_8_, carmodel9_.make_code as make4_3_8_, carmodel9_.name as name3_8_, carmodel9_.year as year3_8_, carmaker10_.code as code2_9_, carmaker10_.amount as amount2_9_, carmaker10_.currency as currency2_9_, carmaker10_.name as name2_9_, carmodel11_.id as id3_10_, carmodel11_.make_code as make4_3_10_, carmodel11_.name as name3_10_, carmodel11_.year as year3_10_, carmaker12_.code as code2_11_, carmaker12_.amount as amount2_11_, carmaker12_.currency as currency2_11_, carmaker12_.name as name2_11_, owner13_.id as id4_12_, owner13_1_.birthDate as birthDate4_12_, owner13_1_.currentAddress_id as currentA6_4_12_, owner13_1_.fiscalAddress_id as fiscalAd7_4_12_, owner13_1_.familyName as familyName4_12_, owner13_1_.givenName as givenName4_12_, owner13_1_.title as title4_12_, address14_.id as id0_13_, address14_.city as city0_13_, address14_.county as county0_13_, address14_.no as no0_13_, address14_.street as street0_13_, address14_.zipCode as zipCode0_13_, address15_.id as id0_14_, address15_.city as city0_14_, address15_.county as county0_14_, address15_.no as no0_14_, address15_.street as street0_14_, address15_.zipCode as zipCode0_14_, car16_.id as id1_15_, car16_.amount as amount1_15_, car16_.currency as currency1_15_, car16_.model_id as model5_1_15_, car16_.owner_id as owner6_1_15_, car16_.registrationDate as registra4_1_15_, carmodel17_.id as id3_16_, carmodel17_.make_code as make4_3_16_, carmodel17_.name as name3_16_, carmodel17_.year as year3_16_, carmaker18_.code as code2_17_, carmaker18_.amount as amount2_17_, carmaker18_.currency as currency2_17_, carmaker18_.name as name2_17_, carmodel19_.id as id3_18_, carmodel19_.make_code as make4_3_18_, carmodel19_.name as name3_18_, carmodel19_.year as year3_18_, carmaker20_.code as code2_19_, carmaker20_.amount as amount2_19_, carmaker20_.currency as currency2_19_, carmaker20_.name as name2_19_, owner44_.id as id4_20_, owner44_1_.birthDate as birthDate4_20_, owner44_1_.currentAddress_id as currentA6_4_20_, owner44_1_.fiscalAddress_id as fiscalAd7_4_20_, owner44_1_.familyName as familyName4_20_, owner44_1_.givenName as givenName4_20_, owner44_1_.title as title4_20_, address45_.id as id0_21_, address45_.city as city0_21_, address45_.county as county0_21_, address45_.no as no0_21_, address45_.street as street0_21_, address45_.zipCode as zipCode0_21_, address46_.id as id0_22_, address46_.city as city0_22_, address46_.county as county0_22_, address46_.no as no0_22_, address46_.street as street0_22_, address46_.zipCode as zipCode0_22_, sticker21_.id as id8_23_, sticker21_.height as height8_23_, sticker21_.name as name8_23_, sticker21_.width as width8_23_, sticker22_.id as id8_24_, sticker22_.height as height8_24_, sticker22_.name as name8_24_, sticker22_.width as width8_24_ from Car this_ inner join CarModel carmodel1_ on this_.model_id=carmodel1_.id inner join CarMaker carmaker2_ on carmodel1_.make_code=carmaker2_.code inner join CarModel carmodel3_ on carmaker2_.code=carmodel3_.make_code inner join CarMaker carmaker4_ on carmodel3_.make_code=carmaker4_.code inner join Owner owner5_ on this_.owner_id=owner5_.id left outer join Person owner5_1_ on owner5_.id=owner5_1_.id inner join Address address6_ on owner5_1_.currentAddress_id=address6_.id inner join Address address7_ on owner5_1_.fiscalAddress_id=address7_.id inner join Car car8_ on owner5_.id=car8_.owner_id inner join CarModel carmodel9_ on car8_.model_id=carmodel9_.id inner join CarMaker carmaker10_ on carmodel9_.make_code=carmaker10_.code inner join CarModel carmodel11_ on carmaker10_.code=carmodel11_.make_code inner join CarMaker carmaker12_ on carmodel11_.make_code=carmaker12_.code inner join Owner owner13_ on car8_.owner_id=owner13_.id left outer join Person owner13_1_ on owner13_.id=owner13_1_.id inner join Address address14_ on owner13_1_.currentAddress_id=address14_.id inner join Address address15_ on owner13_1_.fiscalAddress_id=address15_.id inner join Car car16_ on owner13_.id=car16_.owner_id inner join CarModel carmodel17_ on car16_.model_id=carmodel17_.id inner join CarMaker carmaker18_ on carmodel17_.make_code=carmaker18_.code inner join CarModel carmodel19_ on carmaker18_.code=carmodel19_.make_code inner join CarMaker carmaker20_ on carmodel19_.make_code=carmaker20_.code left outer join Owner owner44_ on car16_.owner_id=owner44_.id left outer join Person owner44_1_ on owner44_.id=owner44_1_.id left outer join Address address45_ on owner44_1_.currentAddress_id=address45_.id left outer join Address address46_ on owner44_1_.fiscalAddress_id=address46_.id inner join Sticker sticker21_ on car16_.id=sticker21_.carId inner join Sticker sticker22_ on car8_.id=sticker22_.carId where (this_.amount=? and this_.currency=? and this_.registrationDate=?) and this_.id = ? and (carmodel1_.name=? and carmodel1_.year=?) and carmodel1_.id = ? and (carmaker2_.amount=? and carmaker2_.currency=? and carmaker2_.name=?) and carmaker2_.code = ? and (carmodel3_.name=? and carmodel3_.year=?) and carmodel3_.id = ? and (carmaker4_.amount=? and carmaker4_.currency=? and carmaker4_.name=?) and carmaker4_.code = ? and (owner5_1_.birthDate=? and owner5_1_.familyName=? and owner5_1_.givenName=?) and owner5_.id = ? and (address6_.city=? and address6_.county=? and address6_.no=? and address6_.street=? and address6_.zipCode=?) and address6_.id = ? and (address7_.city=? and address7_.county=? and address7_.no=? and address7_.street=? and address7_.zipCode=?) and address7_.id = ? and (car8_.amount=? and car8_.currency=? and car8_.registrationDate=?) and car8_.id = ? and (carmodel9_.name=? and carmodel9_.year=?) and carmodel9_.id = ? and (carmaker10_.amount=? and carmaker10_.currency=? and carmaker10_.name=?) and carmaker10_.code = ? and (carmodel11_.name=? and carmodel11_.year=?) and carmodel11_.id = ? and (carmaker12_.amount=? and carmaker12_.currency=? and carmaker12_.name=?) and carmaker12_.code = ? and (owner13_1_.birthDate=? and owner13_1_.familyName=? and owner13_1_.givenName=?) and owner13_.id = ? and (address14_.city=? and address14_.county=? and address14_.no=? and address14_.street=? and address14_.zipCode=?) and address14_.id = ? and (address15_.city=? and address15_.county=? and address15_.no=? and address15_.street=? and address15_.zipCode=?) and address15_.id = ? and (car16_.amount=? and car16_.currency=? and car16_.registrationDate=?) and car16_.id = ? and (carmodel17_.name=? and carmodel17_.year=?) and carmodel17_.id = ? and (carmaker18_.amount=? and carmaker18_.currency=? and carmaker18_.name=?) and carmaker18_.code = ? and (carmodel19_.name=? and carmodel19_.year=?) and carmodel19_.id = ? and (carmaker20_.amount=? and carmaker20_.currency=? and carmaker20_.name=?) and carmaker20_.code = ? and (sticker21_.height=? and sticker21_.name=? and sticker21_.width=?) and sticker21_.id = ? and (sticker22_.height=? and sticker22_.name=? and sticker22_.width=?) and sticker22_.id = ? limit ? TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 5 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 7 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 8 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 9 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 10 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 11 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 12 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 13 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 14 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 15 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 16 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 17 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 18 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 19 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 20 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 21 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 22 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 23 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 24 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 25 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 26 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 27 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 28 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 29 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 30 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 31 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 32 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 33 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 34 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 35 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 36 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 37 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 38 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 39 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 40 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 41 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 42 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 43 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 44 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 45 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 46 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 47 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 48 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 49 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 50 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 51 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 52 TRACE - NullableType.nullSafeSet(153) | binding '1962-02-21 00:00:00' to parameter: 53 TRACE - NullableType.nullSafeSet(153) | binding 'Palahniuk' to parameter: 54 TRACE - NullableType.nullSafeSet(153) | binding 'Chuck' to parameter: 55 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 56 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 57 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 58 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 59 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 60 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 61 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 62 TRACE - NullableType.nullSafeSet(153) | binding 'Pasco' to parameter: 63 TRACE - NullableType.nullSafeSet(153) | binding 'WA' to parameter: 64 TRACE - NullableType.nullSafeSet(153) | binding '2' to parameter: 65 TRACE - NullableType.nullSafeSet(153) | binding 'Awesome Street' to parameter: 66 TRACE - NullableType.nullSafeSet(153) | binding '13121' to parameter: 67 TRACE - NullableType.nullSafeSet(153) | binding '23' to parameter: 68 TRACE - NullableType.nullSafeSet(153) | binding '5400.0' to parameter: 69 TRACE - NullableType.nullSafeSet(153) | binding 'USD' to parameter: 70 TRACE - NullableType.nullSafeSet(153) | binding '2011-12-13 00:00:00' to parameter: 71 TRACE - NullableType.nullSafeSet(153) | binding '5' to parameter: 72 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 73 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 74 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 75 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 76 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 77 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 78 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 79 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 80 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 81 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 82 TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 83 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 84 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 85 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 86 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 87 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 88 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 89 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 90 TRACE - NullableType.nullSafeSet(153) | binding '20.0' to parameter: 91 TRACE - NullableType.nullSafeSet(153) | binding 'Warning! Baby on board!' to parameter: 92 TRACE - NullableType.nullSafeSet(153) | binding '10.0' to parameter: 93 TRACE - NullableType.nullSafeSet(153) | binding '4' to parameter: 94 TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_0_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_1_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_2_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_3_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_4_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_5_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_6_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_7_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_8_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_9_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_10_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_11_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_12_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_13_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_14_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_15_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_16_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_17_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id3_18_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_19_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id4_20_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_21_ TRACE - NullableType.nullSafeGet(195) | returning '23' as column: id0_22_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_23_ TRACE - NullableType.nullSafeGet(195) | returning '4' as column: id8_24_ TRACE - NullableType.nullSafeGet(195) | returning '5' as column: id1_25_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@91e321 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testOneToMany@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (12): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1a4ea4f]; rollback [true] Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Smalltown' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'MI' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '15' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Long road' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '14352' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1970-03-07 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'McBeal' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Alice' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: select person0_.id as id4_3_, person0_.birthDate as birthDate4_3_, person0_.currentAddress_id as currentA6_4_3_, person0_.fiscalAddress_id as fiscalAd7_4_3_, person0_.familyName as familyName4_3_, person0_.givenName as givenName4_3_, person0_.title as title4_3_, person0_1_.department as department5_3_, person0_1_.employedSince as employed2_5_3_, person0_1_.employer_code as employer7_5_3_, person0_1_.amount as amount5_3_, person0_1_.currency as currency5_3_, person0_1_.qualification as qualific5_5_3_, person0_2_.hipsterFactor as hipsterF1_6_3_, case when person0_2_.id is not null then 2 when person0_1_.id is not null then 1 when person0_3_.id is not null then 3 when person0_.id is not null then 0 end as clazz_3_, address1_.id as id0_0_, address1_.city as city0_0_, address1_.county as county0_0_, address1_.no as no0_0_, address1_.street as street0_0_, address1_.zipCode as zipCode0_0_, address2_.id as id0_1_, address2_.city as city0_1_, address2_.county as county0_1_, address2_.no as no0_1_, address2_.street as street0_1_, address2_.zipCode as zipCode0_1_, carmaker3_.code as code2_2_, carmaker3_.amount as amount2_2_, carmaker3_.currency as currency2_2_, carmaker3_.name as name2_2_ from Person person0_ left outer join Employee person0_1_ on person0_.id=person0_1_.id left outer join Designer person0_2_ on person0_.id=person0_2_.id left outer join Owner person0_3_ on person0_.id=person0_3_.id inner join Address address1_ on person0_.currentAddress_id=address1_.id left outer join Address address2_ on person0_.fiscalAddress_id=address2_.id left outer join CarMaker carmaker3_ on person0_1_.employer_code=carmaker3_.code where person0_.id=? TRACE - NullableType.nullSafeSet(153) | binding '24' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: id0_1_ TRACE - NullableType.nullSafeGet(189) | returning null as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning 'Smalltown' as column: city0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'MI' as column: county0_0_ TRACE - NullableType.nullSafeGet(195) | returning '15' as column: no0_0_ TRACE - NullableType.nullSafeGet(195) | returning 'Long road' as column: street0_0_ TRACE - NullableType.nullSafeGet(195) | returning '14352' as column: zipCode0_0_ TRACE - NullableType.nullSafeGet(195) | returning '0' as column: clazz_3_ TRACE - NullableType.nullSafeGet(195) | returning '1970-03-07 00:00:00' as column: birthDate4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: currentA6_4_3_ TRACE - NullableType.nullSafeGet(195) | returning '24' as column: fiscalAd7_4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'McBeal' as column: familyName4_3_ TRACE - NullableType.nullSafeGet(195) | returning 'Alice' as column: givenName4_3_ DEBUG - EnumType.nullSafeGet(103) | Returning null as column title4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@91e321 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveBasic@HibernateDAOPersistenceTest, testException = [null]]] INFO - TransactionalTestExecutionListener.startNewTransaction(260) | Began transaction (13): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@1a4ea4f]; rollback [true] Hibernate: insert into CarMaker (amount, currency, name, code) values (?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '12000.0' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'Toyota' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 4 Hibernate: insert into CarModel (id, make_code, name, year) values (default, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'Prius' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '2008' to parameter: 3 Hibernate: insert into Address (id, city, county, no, street, zipCode) values (default, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'Nagato' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding 'TK' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '6' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Khan avenue' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding '99867' to parameter: 5 Hibernate: insert into Person (id, birthDate, currentAddress_id, fiscalAddress_id, familyName, givenName, title) values (default, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding 'Shiro' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'Ken' to parameter: 5 DEBUG - EnumType.nullSafeSet(135) | Binding null to parameter: 6 Hibernate: insert into Employee (department, employedSince, employer_code, amount, currency, qualification, id) values (?, ?, ?, ?, ?, ?, ?) TRACE - NullableType.nullSafeSet(153) | binding 'design' to parameter: 1 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 2 TRACE - NullableType.nullSafeSet(153) | binding 'TYT' to parameter: 3 TRACE - NullableType.nullSafeSet(153) | binding '60000.0' to parameter: 4 TRACE - NullableType.nullSafeSet(153) | binding 'YEN' to parameter: 5 TRACE - NullableType.nullSafeSet(146) | binding null to parameter: 6 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 7 Hibernate: insert into Designer (hipsterFactor, id) values (?, ?) TRACE - NullableType.nullSafeSet(153) | binding '97' to parameter: 1 TRACE - NullableType.nullSafeSet(153) | binding '25' to parameter: 2 Hibernate: select this_.id as id4_3_, this_.birthDate as birthDate4_3_, this_.currentAddress_id as currentA6_4_3_, this_.fiscalAddress_id as fiscalAd7_4_3_, this_.familyName as familyName4_3_, this_.givenName as givenName4_3_, this_.title as title4_3_, this_1_.department as department5_3_, this_1_.employedSince as employed2_5_3_, this_1_.employer_code as employer7_5_3_, this_1_.amount as amount5_3_, this_1_.currency as currency5_3_, this_1_.qualification as qualific5_5_3_, this_2_.hipsterFactor as hipsterF1_6_3_, case when this_2_.id is not null then 2 when this_1_.id is not null then 1 when this_3_.id is not null then 3 when this_.id is not null then 0 end as clazz_3_, address2_.id as id0_0_, address2_.city as city0_0_, address2_.county as county0_0_, address2_.no as no0_0_, address2_.street as street0_0_, address2_.zipCode as zipCode0_0_, address3_.id as id0_1_, address3_.city as city0_1_, address3_.county as county0_1_, address3_.no as no0_1_, address3_.street as street0_1_, address3_.zipCode as zipCode0_1_, carmaker4_.code as code2_2_, carmaker4_.amount as amount2_2_, carmaker4_.currency as currency2_2_, carmaker4_.name as name2_2_ from Person this_ left outer join Employee this_1_ on this_.id=this_1_.id left outer join Designer this_2_ on this_.id=this_2_.id left outer join Owner this_3_ on this_.id=this_3_.id inner join Address address2_ on this_.currentAddress_id=address2_.id left outer join Address address3_ on this_.fiscalAddress_id=address3_.id left outer join CarMaker carmaker4_ on this_1_.employer_code=carmaker4_.code where (this_.birthDate=?) limit ? TRACE - NullableType.nullSafeSet(153) | binding '1981-10-16 00:00:00' to parameter: 1 TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_0_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id0_1_ TRACE - NullableType.nullSafeGet(195) | returning 'TYT' as column: code2_2_ TRACE - NullableType.nullSafeGet(195) | returning '25' as column: id4_3_ INFO - TransactionalTestExecutionListener.endTransaction(280) | Rolled back transaction after test execution for test context [[TestContext@91e321 testClass = HibernateDAOPersistenceTest, locations = array<String>['classpath:/spring-tests.xml'], testInstance = it.openutils.hibernate.test.HibernateDAOPersistenceTest@de1b8a, testMethod = testSaveAndRetrieveWithCascade@HibernateDAOPersistenceTest, testException = [null]]] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.216 sec Results : Tests run: 18, Failures: 0, Errors: 0, Skipped: 0 INFO - AbstractApplicationContext.doClose(938) | Closing org.springframework.context.support.GenericApplicationContext@50ca0c: startup date [Fri Jun 29 16:50:20 CEST 2012]; root of context hierarchy INFO - DefaultSingletonBeanRegistry.destroySingletons(421) | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@19ecd80: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,carDAO,carMakerDAO,personDAO,stickerDAO,dataSource,sessionFactory,transactionManager]; root of factory hierarchy INFO - AbstractSessionFactoryBean.destroy(246) | Closing Hibernate SessionFactory INFO - SessionFactoryImpl.close(940) | closing INFO - SchemaExport.execute(226) | Running hbm2ddl schema export INFO - SchemaExport.execute(251) | exporting generated schema to database INFO - SchemaExport.execute(268) | schema export complete [JENKINS] Recording test results [INFO] [bundle:bundle {execution: default-bundle}] [INFO] Preparing source:jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [INFO] No goals needed for project - skipping [INFO] [source:jar {execution: attach-sources}] [INFO] Building jar: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> [INFO] [assembly:single {execution: bundle}] [INFO] Reading assembly descriptor: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/src/main/assembly/assembly-bundle.xml> [INFO] Building zip: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT-bundle.zip> [INFO] [license:check {execution: default}] [INFO] Checking licenses... [INFO] Missing header in: <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/src/test/java/it/openutils/hibernate/test/EntityBuilder.java> [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/pom.xml> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_16-50-03/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/pom.xml [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_16-50-03/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT.jar [JENKINS] Archiving <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/ws/target/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar> to /data/hudson-data/jobs/openutils-bshd5/modules/net.sourceforge.openutils$openutils-bshd5/builds/2012-06-29_16-50-03/archive/net.sourceforge.openutils/openutils-bshd5/3.0.0-SNAPSHOT/openutils-bshd5-3.0.0-SNAPSHOT-sources.jar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Some files do not have the expected license header [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23 seconds [INFO] Finished at: Fri Jun 29 16:50:31 CEST 2012 [INFO] Final Memory: 52M/293M [INFO] ------------------------------------------------------------------------ |
From: <gca...@us...> - 2012-06-29 15:10:29
|
Revision: 4076 http://openutils.svn.sourceforge.net/openutils/?rev=4076&view=rev Author: gcatania Date: 2012-06-29 15:10:22 +0000 (Fri, 29 Jun 2012) Log Message: ----------- BSHD-15 source code refactor and cleanup Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Added Paths: ----------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 14:26:07 UTC (rev 4075) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 15:10:22 UTC (rev 4076) @@ -25,11 +25,10 @@ package it.openutils.hibernate.example; +import it.openutils.hibernate.selectors.ExcludeBackrefPropertySelector; + import java.io.Serializable; -import java.lang.reflect.Array; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -37,7 +36,6 @@ import java.util.Map; import java.util.Set; -import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.EntityMode; import org.hibernate.Hibernate; @@ -50,7 +48,6 @@ import org.hibernate.criterion.Restrictions; import org.hibernate.engine.SessionImplementor; import org.hibernate.metadata.ClassMetadata; -import org.hibernate.property.BackrefPropertyAccessor; import org.hibernate.type.Type; @@ -67,7 +64,7 @@ private Character escapeCharacter; - private PropertySelector selector = new ExcludeBackrefPropertySelector(); // BSHD-15 + private PropertySelector selector = new ExcludeBackrefPropertySelector(ExampleTreePropertySelectorSupport.NOT_NULL); // BSHD-15 private MatchMode matchMode; @@ -260,7 +257,7 @@ private void createSubExamples(Criteria crit, Object entity, String[] walkedProperties) { - String associationPath = getAssociationPath(walkedProperties); + String associationPath = ExampleTreeUtils.getPath(walkedProperties); crit.add(example(entity, associationPath)); for (Criterion c : getAdditionalConditions(associationPath)) { @@ -281,7 +278,7 @@ continue; } String propertyName = names[i]; - if (alreadyWalked(walkedProperties, propertyName)) + if (ExampleTreeUtils.alreadyWalked(walkedProperties, propertyName)) { continue; } @@ -289,7 +286,7 @@ Object propertyValue = classMetadata.getPropertyValue(entity, propertyName, entityMode); if (propertyType.isCollectionType()) { - propertyValue = getValueFromCollection(propertyValue); + propertyValue = ExampleTreeUtils.getValueFromCollection(propertyValue); } if (propertyValue == null) { @@ -298,7 +295,7 @@ } Criteria subCrit = crit.createCriteria(propertyName); - String[] subProperties = append(walkedProperties, propertyName); + String[] subProperties = ExampleTreeUtils.append(walkedProperties, propertyName); createSubExamples(subCrit, propertyValue, subProperties); } } @@ -322,11 +319,6 @@ } } - private String getAssociationPath(String[] walkedProperties) - { - return walkedProperties.length > 0 ? StringUtils.join(walkedProperties, '.') : StringUtils.EMPTY; - } - private Example example(Object entity, String associationPath) { Example ex = Example.create(entity); @@ -364,128 +356,13 @@ return result; } - /** - * check the property with the input name was already walked in the input path - * @param path the current path - * @param propertyName the property name about to be walked - * @return true if the property with the input name was already walked in the input path - */ - private boolean alreadyWalked(String[] walkedProperties, String propertyName) - { - if (walkedProperties.length <= 2) - { - return false; - } - String parent = walkedProperties[walkedProperties.length - 1]; - boolean lastWasChild = false; - for (int i = walkedProperties.length - 2; i > 0; i--) - { - String currPropertyName = walkedProperties[i]; - if (currPropertyName.equals(propertyName)) - { - lastWasChild = true; - continue; - } - if (lastWasChild) - { - if (currPropertyName.equals(parent)) - { - return true; - } - else - { - lastWasChild = false; - } - } - } - return false; - } - - // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 - private Object getValueFromCollection(Object collectionValue) - { - if (collectionValue != null) - { - if (collectionValue instanceof Collection< ? >) - { - Collection< ? > coll = (Collection< ? >) collectionValue; - int size = coll.size(); - if (size == 1) - { - return coll.iterator().next(); - } - if (size > 1) - { - throw new IllegalArgumentException("More than one element in filter collection is unsupported."); - } - } - Class< ? extends Object> clazz = collectionValue.getClass(); - if (clazz.isArray()) - { - int length = Array.getLength(collectionValue); - if (length == 1) - { - return Array.get(collectionValue, 0); - } - if (length > 1) - { - throw new IllegalArgumentException("More than one element in filter array is unsupported."); - } - } - // TODO other cases? - } - return null; - } - - private String[] append(String[] propertyNames, String propertyName) - { - String[] result = Arrays.copyOf(propertyNames, propertyNames.length + 1); - result[propertyNames.length] = propertyName; - return result; - } } - } /** - * support for BSHD-15 - * @author gcatania - * @version $Id$ - */ -class ExcludeBackrefPropertySelector implements PropertySelector -{ - - private static final long serialVersionUID = -2803322309158823550L; - - private final PropertySelector selector; - - public ExcludeBackrefPropertySelector(PropertySelector selector) - { - this.selector = selector; - } - - public ExcludeBackrefPropertySelector() - { - selector = ExampleTreePropertySelectorSupport.NOT_NULL; - } - - public boolean include(Object propertyValue, String propertyName, Type type) - { - if (BackrefPropertyAccessor.UNKNOWN.equals(propertyValue)) - { - return false; - } - return selector.include(propertyValue, propertyName, type); - } - -} - - -/** * workaround to {@link Example} not exposing internal property selectors * @author gcatania - * @version $Id$ */ @SuppressWarnings({"serial", "static-method"}) class ExampleTreePropertySelectorSupport Added: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java (rev 0) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java 2012-06-29 15:10:22 UTC (rev 4076) @@ -0,0 +1,125 @@ +/** + * Copyright (c) Energeya LLC. All rights reserved. http://www.energeya.com + */ +package it.openutils.hibernate.example; + +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.Collection; + +import org.apache.commons.lang3.StringUtils; + + +/** + * @author gcatania + * @version $Id$ + */ +final class ExampleTreeUtils +{ + + private ExampleTreeUtils() + { + } + + /** + * check the property with the input name was already walked in the input path + * @param path the current path + * @param propertyName the property name about to be walked + * @return true if the property with the input name was already walked in the input path + */ + public static boolean alreadyWalked(String[] walkedProperties, String propertyName) + { + if (walkedProperties.length <= 2) + { + return false; + } + String parent = walkedProperties[walkedProperties.length - 1]; + boolean lastWasChild = false; + for (int i = walkedProperties.length - 2; i > 0; i--) + { + String currPropertyName = walkedProperties[i]; + if (currPropertyName.equals(propertyName)) + { + lastWasChild = true; + continue; + } + if (lastWasChild) + { + if (currPropertyName.equals(parent)) + { + return true; + } + else + { + lastWasChild = false; + } + } + } + return false; + } + + /** + * retrieves a value from a collection + * @param collectionValue the collection + * @return a value + * @see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 + * @throws IllegalArgumentException if the input collection contains more than one value + */ + public static Object getValueFromCollection(Object collectionValue) throws IllegalArgumentException + { + if (collectionValue != null) + { + if (collectionValue instanceof Collection< ? >) + { + Collection< ? > coll = (Collection< ? >) collectionValue; + int size = coll.size(); + if (size == 1) + { + return coll.iterator().next(); + } + if (size > 1) + { + throw new IllegalArgumentException("More than one element in filter collection is unsupported."); + } + } + Class< ? extends Object> clazz = collectionValue.getClass(); + if (clazz.isArray()) + { + int length = Array.getLength(collectionValue); + if (length == 1) + { + return Array.get(collectionValue, 0); + } + if (length > 1) + { + throw new IllegalArgumentException("More than one element in filter array is unsupported."); + } + } + // TODO other cases? + } + return null; + } + + /** + * @param strings an array of strings + * @param s the string to append + * @return a new array containing the input string array plus the input string at the end + */ + public static String[] append(String[] strings, String s) + { + String[] result = Arrays.copyOf(strings, strings.length + 1); + result[strings.length] = s; + return result; + } + + /** + * constructs the association path from an array of property names + * @param propertyNames the walked properties + * @return the association path + */ + public static String getPath(String[] propertyNames) + { + return propertyNames.length > 0 ? StringUtils.join(propertyNames, '.') : StringUtils.EMPTY; + } + +} Property changes on: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTreeUtils.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 14:26:07 UTC (rev 4075) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 15:10:22 UTC (rev 4076) @@ -25,15 +25,13 @@ package it.openutils.hibernate.example; -import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.Collection; +import it.openutils.hibernate.selectors.ExcludeBackrefPropertySelector; + import java.util.HashMap; import java.util.Map; import java.util.Set; import org.apache.commons.collections.MapUtils; -import org.apache.commons.lang3.StringUtils; import org.hibernate.Criteria; import org.hibernate.EntityMode; import org.hibernate.Hibernate; @@ -117,7 +115,7 @@ private void createSubExamples(Criteria crit, Object entity, String[] walkedProperties) { - String path = getPath(walkedProperties); + String path = ExampleTreeUtils.getPath(walkedProperties); Map<String, FilterMetadata> currFilterMetadata = getFilterMetadata(path); crit.add(example(entity, currFilterMetadata.keySet())); ClassMetadata classMetadata = sessionFactory.getClassMetadata(Hibernate.getClass(entity)); @@ -126,7 +124,7 @@ for (int i = 0; i < types.length; i++) { String propertyName = names[i]; - if (alreadyWalked(walkedProperties, propertyName)) + if (ExampleTreeUtils.alreadyWalked(walkedProperties, propertyName)) { continue; } @@ -147,7 +145,7 @@ if (propertyType.isCollectionType()) { - propertyValue = getValueFromCollection(propertyValue); + propertyValue = ExampleTreeUtils.getValueFromCollection(propertyValue); } if (propertyValue == null) { @@ -156,7 +154,7 @@ } Criteria subCrit = crit.createCriteria(propertyName); - String[] subProperties = append(walkedProperties, propertyName); + String[] subProperties = ExampleTreeUtils.append(walkedProperties, propertyName); createSubExamples(subCrit, propertyValue, subProperties); } } @@ -185,15 +183,10 @@ return result; } - private String getPath(String[] walkedProperties) - { - return walkedProperties.length > 0 ? StringUtils.join(walkedProperties, '.') : StringUtils.EMPTY; - } - private Example example(Object entity, Set<String> propertiesToExclude) { Example ex = Example.create(entity); - ex.setPropertySelector(new ExcludeBackrefPropertySelector()); // BSHD-15 + ex.setPropertySelector(new ExcludeBackrefPropertySelector(ExampleTreePropertySelectorSupport.NOT_NULL)); // BSHD-15 for (String propertyName : propertiesToExclude) { // skip properties handled by filterMetadata @@ -202,84 +195,6 @@ return ex; } - /** - * check the property with the input name was already walked in the input path - * @param path the current path - * @param propertyName the property name about to be walked - * @return true if the property with the input name was already walked in the input path - */ - private boolean alreadyWalked(String[] walkedProperties, String propertyName) - { - if (walkedProperties.length <= 2) - { - return false; - } - String parent = walkedProperties[walkedProperties.length - 1]; - boolean lastWasChild = false; - for (int i = walkedProperties.length - 2; i > 0; i--) - { - String currPropertyName = walkedProperties[i]; - if (currPropertyName.equals(propertyName)) - { - lastWasChild = true; - continue; - } - if (lastWasChild) - { - if (currPropertyName.equals(parent)) - { - return true; - } - else - { - lastWasChild = false; - } - } - } - return false; - } - - private Object getValueFromCollection(Object collectionValue) - { - if (collectionValue != null) - { - if (collectionValue instanceof Collection< ? >) - { - Collection< ? > coll = (Collection< ? >) collectionValue; - int size = coll.size(); - if (size == 1) - { - return coll.iterator().next(); - } - if (size > 1) - { - throw new IllegalArgumentException("More than one element in filter collection is unsupported."); - } - } - Class< ? extends Object> clazz = collectionValue.getClass(); - if (clazz.isArray()) - { - int length = Array.getLength(collectionValue); - if (length == 1) - { - return Array.get(collectionValue, 0); - } - if (length > 1) - { - throw new IllegalArgumentException("More than one element in filter array is unsupported."); - } - } - // TODO other cases? - } - return null; - } - - private String[] append(String[] propertyNames, String propertyName) - { - String[] result = Arrays.copyOf(propertyNames, propertyNames.length + 1); - result[propertyNames.length] = propertyName; - return result; - } } } Added: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java (rev 0) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java 2012-06-29 15:10:22 UTC (rev 4076) @@ -0,0 +1,44 @@ +/** + * Copyright (c) Energeya LLC. All rights reserved. http://www.energeya.com + */ +package it.openutils.hibernate.selectors; + +import java.io.Serializable; + +import org.hibernate.criterion.Example.PropertySelector; +import org.hibernate.property.BackrefPropertyAccessor; +import org.hibernate.type.Type; + + +/** + * utility selector to avoid class cast exceptions on {@link BackrefPropertyAccessor.UNKNOWN} + * @see BSHD-15 + * @author gcatania + * @version $Id$ + */ +public class ExcludeBackrefPropertySelector implements PropertySelector, Serializable +{ + + private static final long serialVersionUID = -2803322309158823550L; + + private final PropertySelector selector; + + public ExcludeBackrefPropertySelector(PropertySelector selector) + { + if (selector == null) + { + throw new NullPointerException("Null selector."); + } + this.selector = selector; + } + + public boolean include(Object propertyValue, String propertyName, Type type) + { + if (BackrefPropertyAccessor.UNKNOWN.equals(propertyValue)) + { + return false; + } + return selector.include(propertyValue, propertyName, type); + } + +} Property changes on: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/selectors/ExcludeBackrefPropertySelector.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 14:26:17
|
Revision: 4075 http://openutils.svn.sourceforge.net/openutils/?rev=4075&view=rev Author: gcatania Date: 2012-06-29 14:26:07 +0000 (Fri, 29 Jun 2012) Log Message: ----------- cleanup unit tests Modified Paths: -------------- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java Added Paths: ----------- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java Added: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java (rev 0) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java 2012-06-29 14:26:07 UTC (rev 4075) @@ -0,0 +1,148 @@ +/** + * Copyright (c) Energeya LLC. All rights reserved. http://www.energeya.com + */ +package it.openutils.hibernate.test; + +import it.openutils.hibernate.test.model.Address; +import it.openutils.hibernate.test.model.Car; +import it.openutils.hibernate.test.model.CarMaker; +import it.openutils.hibernate.test.model.CarModel; +import it.openutils.hibernate.test.model.CurrencyAmount; +import it.openutils.hibernate.test.model.Designer; +import it.openutils.hibernate.test.model.FullName; +import it.openutils.hibernate.test.model.Owner; +import it.openutils.hibernate.test.model.Person; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.GregorianCalendar; +import java.util.List; + + +/** + * @author gcatania + * @version $Id$ + */ +public final class EntityBuilder +{ + + private EntityBuilder() + { + } + + public static Person alice() + { + FullName fullName = new FullName("Alice", "McBeal"); + Calendar birthDate = new GregorianCalendar(1970, Calendar.MARCH, 7); + Address address = new Address("Long road", 15, "Smalltown", "MI", 14352); + Person p = new Person(); + p.setName(fullName); + p.setBirthDate(birthDate); + p.setFiscalAddress(address); + p.setCurrentAddress(address); + return p; + } + + public static Owner bob() + { + FullName fullName = new FullName("Bob", "Kelso"); + Calendar birthDate = new GregorianCalendar(1950, Calendar.MARCH, 7); + Address address = new Address("Sacred Heart Lane", 3, "Smalltown", "CA", 11243); + Owner o = new Owner(); + o.setName(fullName); + o.setBirthDate(birthDate); + o.setFiscalAddress(address); + o.setCurrentAddress(address); + return o; + } + + public static Owner chuck() + { + FullName fullName = new FullName("Chuck", "Palahniuk"); + Calendar birthDate = new GregorianCalendar(1962, Calendar.FEBRUARY, 21); + Address address = new Address("Awesome Street", 2, "Pasco", "WA", 13121); + Owner p = new Owner(); + p.setName(fullName); + p.setBirthDate(birthDate); + p.setFiscalAddress(address); + p.setCurrentAddress(address); + return p; + } + + public static CarMaker toyota() + { + CarMaker toyota = new CarMaker(); + toyota.setCode("TYT"); + toyota.setName("Toyota"); + toyota.setCapitalization(new CurrencyAmount(12000, "YEN")); + return toyota; + } + + public static CarMaker fiat() + { + CarMaker fiat = new CarMaker(); + fiat.setCode("FIA"); + fiat.setName("Fabbrica Italiana Automobili Torino"); + fiat.setCapitalization(new CurrencyAmount(80000, "EUR")); + return fiat; + } + + public static CarModel prius(CarMaker toyota) + { + CarModel prius = new CarModel(); + prius.setName("Prius"); + prius.setMake(toyota); + prius.setYear(Integer.valueOf(2008)); + + List<CarModel> toyotaModels = toyota.getModels(); + if (toyotaModels == null) + { + toyotaModels = new ArrayList<CarModel>(); + } + toyotaModels.add(prius); + toyota.setModels(toyotaModels); + return prius; + } + + public static Designer priusDesigner(CarModel prius) + { + FullName fullName = new FullName("Ken", "Shiro"); + Calendar birthDate = new GregorianCalendar(1981, Calendar.OCTOBER, 16); + Address address = new Address("Khan avenue", 6, "Nagato", "TK", 99867); + Designer p = new Designer(); + p.setName(fullName); + p.setBirthDate(birthDate); + p.setFiscalAddress(address); + p.setCurrentAddress(address); + p.setDepartment("design"); + p.setEmployer(prius.getMake()); + p.setDesignedModels(Collections.singleton(prius)); + p.setGrossAnnualSalary(new CurrencyAmount(60000, "YEN")); + p.setHipsterFactor(97); + return p; + } + + public static Car bobsPrius(Owner bob, CarModel prius) + { + Car bobsPrius = new Car(); + bobsPrius.setModel(prius); + bobsPrius.setRegistrationDate(new GregorianCalendar(2010, Calendar.OCTOBER, 28)); + bobsPrius.setMarketValue(new CurrencyAmount(1700, "USD")); + bobsPrius.setOwner(bob); + bob.setCars(Collections.singleton(bobsPrius)); + return bobsPrius; + } + + public static Car chucksPrius(Owner chuck, CarModel prius) + { + Car chucksPrius = new Car(); + chucksPrius.setModel(prius); + chucksPrius.setRegistrationDate(new GregorianCalendar(2011, Calendar.DECEMBER, 13)); + chucksPrius.setMarketValue(new CurrencyAmount(5400, "USD")); + chucksPrius.setOwner(chuck); + chuck.setCars(Collections.singleton(chucksPrius)); + return chucksPrius; + } + +} Property changes on: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/EntityBuilder.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-06-29 13:17:38 UTC (rev 4074) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-06-29 14:26:07 UTC (rev 4075) @@ -25,6 +25,15 @@ package it.openutils.hibernate.test; +import static it.openutils.hibernate.test.EntityBuilder.alice; +import static it.openutils.hibernate.test.EntityBuilder.bob; +import static it.openutils.hibernate.test.EntityBuilder.bobsPrius; +import static it.openutils.hibernate.test.EntityBuilder.chuck; +import static it.openutils.hibernate.test.EntityBuilder.chucksPrius; +import static it.openutils.hibernate.test.EntityBuilder.fiat; +import static it.openutils.hibernate.test.EntityBuilder.prius; +import static it.openutils.hibernate.test.EntityBuilder.priusDesigner; +import static it.openutils.hibernate.test.EntityBuilder.toyota; import it.openutils.hibernate.test.dao.CarDAO; import it.openutils.hibernate.test.dao.CarMakerDAO; import it.openutils.hibernate.test.dao.PersonDAO; @@ -40,11 +49,8 @@ import it.openutils.hibernate.test.model.Person; import it.openutils.hibernate.test.model.Sticker; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Calendar; import java.util.Collections; -import java.util.GregorianCalendar; import java.util.List; import org.hibernate.criterion.Example; @@ -80,120 +86,6 @@ @Autowired private StickerDAO stickerDAO; - private static Person alice() - { - FullName fullName = new FullName("Alice", "McBeal"); - Calendar birthDate = new GregorianCalendar(1970, Calendar.MARCH, 7); - Address address = new Address("Long road", 15, "Smalltown", "MI", 14352); - Person p = new Person(); - p.setName(fullName); - p.setBirthDate(birthDate); - p.setFiscalAddress(address); - p.setCurrentAddress(address); - return p; - } - - private static Owner bob() - { - FullName fullName = new FullName("Bob", "Kelso"); - Calendar birthDate = new GregorianCalendar(1950, Calendar.MARCH, 7); - Address address = new Address("Sacred Heart Lane", 3, "Smalltown", "CA", 11243); - Owner o = new Owner(); - o.setName(fullName); - o.setBirthDate(birthDate); - o.setFiscalAddress(address); - o.setCurrentAddress(address); - return o; - } - - private static Owner chuck() - { - FullName fullName = new FullName("Chuck", "Palahniuk"); - Calendar birthDate = new GregorianCalendar(1962, Calendar.FEBRUARY, 21); - Address address = new Address("Awesome Street", 2, "Pasco", "WA", 13121); - Owner p = new Owner(); - p.setName(fullName); - p.setBirthDate(birthDate); - p.setFiscalAddress(address); - p.setCurrentAddress(address); - return p; - } - - private static CarMaker toyota() - { - CarMaker toyota = new CarMaker(); - toyota.setCode("TYT"); - toyota.setName("Toyota"); - toyota.setCapitalization(new CurrencyAmount(12000, "YEN")); - return toyota; - } - - private static CarMaker fiat() - { - CarMaker fiat = new CarMaker(); - fiat.setCode("FIA"); - fiat.setName("Fabbrica Italiana Automobili Torino"); - fiat.setCapitalization(new CurrencyAmount(80000, "EUR")); - return fiat; - } - - private static CarModel prius(CarMaker toyota) - { - CarModel prius = new CarModel(); - prius.setName("Prius"); - prius.setMake(toyota); - prius.setYear(Integer.valueOf(2008)); - - List<CarModel> toyotaModels = toyota.getModels(); - if (toyotaModels == null) - { - toyotaModels = new ArrayList<CarModel>(); - } - toyotaModels.add(prius); - toyota.setModels(toyotaModels); - return prius; - } - - private static Designer priusDesigner(CarModel prius) - { - FullName fullName = new FullName("Ken", "Shiro"); - Calendar birthDate = new GregorianCalendar(1981, Calendar.OCTOBER, 16); - Address address = new Address("Khan avenue", 6, "Nagato", "TK", 99867); - Designer p = new Designer(); - p.setName(fullName); - p.setBirthDate(birthDate); - p.setFiscalAddress(address); - p.setCurrentAddress(address); - p.setDepartment("design"); - p.setEmployer(prius.getMake()); - p.setDesignedModels(Collections.singleton(prius)); - p.setGrossAnnualSalary(new CurrencyAmount(60000, "YEN")); - p.setHipsterFactor(97); - return p; - } - - private static Car bobsPrius(Owner bob, CarModel prius) - { - Car bobsPrius = new Car(); - bobsPrius.setModel(prius); - bobsPrius.setRegistrationDate(new GregorianCalendar(2010, Calendar.OCTOBER, 28)); - bobsPrius.setMarketValue(new CurrencyAmount(1700, "USD")); - bobsPrius.setOwner(bob); - bob.setCars(Collections.singleton(bobsPrius)); - return bobsPrius; - } - - private static Car chucksPrius(Owner chuck, CarModel prius) - { - Car chucksPrius = new Car(); - chucksPrius.setModel(prius); - chucksPrius.setRegistrationDate(new GregorianCalendar(2011, Calendar.DECEMBER, 13)); - chucksPrius.setMarketValue(new CurrencyAmount(5400, "USD")); - chucksPrius.setOwner(chuck); - chuck.setCars(Collections.singleton(chucksPrius)); - return chucksPrius; - } - /** * basic save/evict/get test. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 13:17:47
|
Revision: 4074 http://openutils.svn.sourceforge.net/openutils/?rev=4074&view=rev Author: gcatania Date: 2012-06-29 13:17:38 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Merged revisions 4073 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4073 | gcatania | 2012-06-29 15:14:53 +0200 (Fri, 29 Jun 2012) | 1 line BSHD-15 fixed for FilterMetadataSupport, readability improvement ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4073&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Property Changed: ---------------- branches/openutils-bshd5-backport/ branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/openutils-bshd5:1-4040,4042-4056,4058-4071 + /trunk/openutils-bshd5:1-4040,4042-4056,4058-4073 Modified: svn:mergeinfo - /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070* + /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070*,4073* Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070 + /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070,4073 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070 + /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070,4073 Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 13:14:53 UTC (rev 4073) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 13:17:38 UTC (rev 4074) @@ -67,7 +67,7 @@ private Character escapeCharacter; - private PropertySelector selector; + private PropertySelector selector = new ExcludeBackrefPropertySelector(); // BSHD-15 private MatchMode matchMode; @@ -343,7 +343,7 @@ { ex.ignoreCase(); } - ex.setPropertySelector(selector != null ? selector : new ExcludeBackrefPropertySelector()); // BSHD-15 + ex.setPropertySelector(selector); Set<String> excludedPropertiesForPath = excludedProperties.get(associationPath); if (excludedPropertiesForPath != null) { Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 13:14:53 UTC (rev 4073) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 13:17:38 UTC (rev 4074) @@ -193,6 +193,7 @@ private Example example(Object entity, Set<String> propertiesToExclude) { Example ex = Example.create(entity); + ex.setPropertySelector(new ExcludeBackrefPropertySelector()); // BSHD-15 for (String propertyName : propertiesToExclude) { // skip properties handled by filterMetadata This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-29 13:14:59
|
Revision: 4073 http://openutils.svn.sourceforge.net/openutils/?rev=4073&view=rev Author: gcatania Date: 2012-06-29 13:14:53 +0000 (Fri, 29 Jun 2012) Log Message: ----------- BSHD-15 fixed for FilterMetadataSupport, readability improvement Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-22 15:59:20 UTC (rev 4072) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-29 13:14:53 UTC (rev 4073) @@ -67,7 +67,7 @@ private Character escapeCharacter; - private PropertySelector selector; + private PropertySelector selector = new ExcludeBackrefPropertySelector(); // BSHD-15 private MatchMode matchMode; @@ -342,7 +342,7 @@ { ex.ignoreCase(); } - ex.setPropertySelector(selector != null ? selector : new ExcludeBackrefPropertySelector()); // BSHD-15 + ex.setPropertySelector(selector); Set<String> excludedPropertiesForPath = excludedProperties.get(associationPath); if (excludedPropertiesForPath != null) { Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-22 15:59:20 UTC (rev 4072) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-06-29 13:14:53 UTC (rev 4073) @@ -193,6 +193,7 @@ private Example example(Object entity, Set<String> propertiesToExclude) { Example ex = Example.create(entity); + ex.setPropertySelector(new ExcludeBackrefPropertySelector()); // BSHD-15 for (String propertyName : propertiesToExclude) { // skip properties handled by filterMetadata This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2012-06-22 17:03:42
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/65/changes> |
From: <hu...@op...> - 2012-06-22 17:03:41
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/65/changes> |
From: <hu...@op...> - 2012-06-22 16:03:38
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/changes> |
From: <hu...@op...> - 2012-06-22 16:03:33
|
See <https://hudson.openmindonline.it/job/openutils-bshd5/net.sourceforge.openutils$openutils-bshd5/changes> |
From: <gca...@us...> - 2012-06-22 15:59:28
|
Revision: 4072 http://openutils.svn.sourceforge.net/openutils/?rev=4072&view=rev Author: gcatania Date: 2012-06-22 15:59:20 +0000 (Fri, 22 Jun 2012) Log Message: ----------- Merged revisions 4069-4070 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4069 | gcatania | 2012-06-22 13:17:21 +0200 (Fri, 22 Jun 2012) | 1 line BSHD-2 adding clone on test dataobjects, fix unidirectional manyToOne ........ r4070 | gcatania | 2012-06-22 17:51:52 +0200 (Fri, 22 Jun 2012) | 1 line BSHD-15 fix example support for backref properties, added unit test ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4069&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4070&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Address.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Car.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarMaker.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarModel.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CurrencyAmount.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Designer.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Employee.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/FullName.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Owner.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Person.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Sticker.java branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Title.java Property Changed: ---------------- branches/openutils-bshd5-backport/ branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/openutils-bshd5:1-4040,4042-4047,4059,4060 + /trunk/openutils-bshd5:1-4040,4042-4056,4058-4071 Modified: svn:mergeinfo - /trunk/openutils-bshd5:4045-4047*,4057,4059 + /trunk/openutils-bshd5:4045-4047*,4057,4059,4069-4070* Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/pom.xml:4045-4047,4059 + /trunk/openutils-bshd5/pom.xml:4045-4047,4059,4069-4070 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/openutils-bshd5/src:4045-4047,4057 + /trunk/openutils-bshd5/src:4045-4047,4057,4069-4070 Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -50,6 +50,7 @@ import org.hibernate.criterion.Restrictions; import org.hibernate.engine.SessionImplementor; import org.hibernate.metadata.ClassMetadata; +import org.hibernate.property.BackrefPropertyAccessor; import org.hibernate.type.Type; @@ -68,8 +69,6 @@ private PropertySelector selector; - private DefaultPropertySelector defaultSelector = DefaultPropertySelector.NOT_NULL; - private MatchMode matchMode; private boolean isIgnoreCaseEnabled; @@ -132,8 +131,11 @@ */ public ExampleTree setPropertySelector(PropertySelector selector) { - this.selector = selector; - defaultSelector = null; + if (selector == null) + { + throw new NullPointerException("Null selector specified"); + } + this.selector = new ExcludeBackrefPropertySelector(selector); // BSHD-15 return this; } @@ -143,7 +145,7 @@ */ public ExampleTree excludeZeroes() { - return setDefaultSelector(DefaultPropertySelector.NOT_NULL_OR_ZERO); + return setPropertySelector(ExampleTreePropertySelectorSupport.NOT_NULL_OR_ZERO); } /** @@ -152,7 +154,7 @@ */ public ExampleTree excludeNone() { - return setDefaultSelector(DefaultPropertySelector.ALL); + return setPropertySelector(ExampleTreePropertySelectorSupport.ALL); } /** @@ -235,17 +237,6 @@ return add(associationPath, override); } - private static enum DefaultPropertySelector { - NOT_NULL, NOT_NULL_OR_ZERO, ALL; - } - - private ExampleTree setDefaultSelector(DefaultPropertySelector defaultSelector) - { - this.defaultSelector = defaultSelector; - selector = null; - return this; - } - private class ExampleTreeWalker implements Serializable { @@ -352,24 +343,7 @@ { ex.ignoreCase(); } - if (selector != null) - { - ex.setPropertySelector(selector); - } - else - { - switch (defaultSelector) - { - case NOT_NULL_OR_ZERO : - ex.excludeZeroes(); - break; - case ALL : - ex.excludeNone(); - break; - default : - break; - } - } + ex.setPropertySelector(selector != null ? selector : new ExcludeBackrefPropertySelector()); // BSHD-15 Set<String> excludedPropertiesForPath = excludedProperties.get(associationPath); if (excludedPropertiesForPath != null) { @@ -473,3 +447,97 @@ } } + + +/** + * support for BSHD-15 + * @author gcatania + * @version $Id$ + */ +class ExcludeBackrefPropertySelector implements PropertySelector +{ + + private static final long serialVersionUID = -2803322309158823550L; + + private final PropertySelector selector; + + public ExcludeBackrefPropertySelector(PropertySelector selector) + { + this.selector = selector; + } + + public ExcludeBackrefPropertySelector() + { + selector = ExampleTreePropertySelectorSupport.NOT_NULL; + } + + public boolean include(Object propertyValue, String propertyName, Type type) + { + if (BackrefPropertyAccessor.UNKNOWN.equals(propertyValue)) + { + return false; + } + return selector.include(propertyValue, propertyName, type); + } + +} + + +/** + * workaround to {@link Example} not exposing internal property selectors + * @author gcatania + * @version $Id$ + */ +@SuppressWarnings({"serial", "static-method"}) +class ExampleTreePropertySelectorSupport +{ + + static final PropertySelector NOT_NULL = new NotNullPropertySelector(); + + static final PropertySelector ALL = new AllPropertySelector(); + + static final PropertySelector NOT_NULL_OR_ZERO = new NotNullOrZeroPropertySelector(); + + static final class AllPropertySelector implements PropertySelector + { + + public boolean include(Object object, String propertyName, Type type) + { + return true; + } + + private Object readResolve() + { + return ALL; + } + } + + static final class NotNullPropertySelector implements PropertySelector + { + + public boolean include(Object object, String propertyName, Type type) + { + return object != null; + } + + private Object readResolve() + { + return NOT_NULL; + } + } + + static final class NotNullOrZeroPropertySelector implements PropertySelector + { + + public boolean include(Object object, String propertyName, Type type) + { + return object != null && (!(object instanceof Number) || ((Number) object).longValue() != 0); + } + + private Object readResolve() + { + return NOT_NULL_OR_ZERO; + } + } + +} \ No newline at end of file Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -65,7 +65,7 @@ /* * TODO tests to perform: 1) find filtered with collection with zero, one or more elements 2) find filtered with - * additional criteria 3) filter metadata support 4) find filtered with id 5) find filtered with backref + * additional criteria 3) filter metadata support */ @Autowired @@ -221,7 +221,7 @@ Designer designer = priusDesigner(prius); personDAO.save(designer); - // FIXME evicting breaks the test, there must be something wrong in the hibernate mapping configuration + // evicting breaks equals() on persistent bags // personDAO.evict(designer); // cannot use load() with entity inheritance, see https://forum.hibernate.org/viewtopic.php?p=2418875 @@ -485,6 +485,44 @@ Assert.assertEquals(alicesProperties[1], alice.getBirthDate()); } + + /** + * BSHD-15 check backref property accessors + */ + @Test + public void testOneToMany() + { + Sticker st1 = new Sticker(); + st1.setName("Warning! Baby on board!"); + st1.setHeight(20d); + st1.setWidth(10d); + Sticker st2 = new Sticker(); + st2.setName("Objects in the mirror are losing"); + st2.setHeight(5d); + st2.setWidth(10d); + + Car chucksPrius = chucksPrius(chuck(), prius(toyota())); + chucksPrius.setStickers(Collections.singletonList(st1)); + Long savedId = carDAO.save(chucksPrius); + chucksPrius = carDAO.load(savedId); + // evicting breaks equals() on persistent bags + // carDAO.evict(chucksPrius); + + Car filter = chucksPrius.clone(); + // filter.setOwner(null); + // filter.setModel(null); + filter.setStickers(null); + // filter.setRegistrationDate(null); + // filter.setMarketValue(null); + // filter.setId(null); + + Car found = carDAO.findFilteredFirst(filter); + Assert.assertEquals(found, chucksPrius); + + // found = carDAO.findFilteredFirst(chucksPrius); + // Assert.assertEquals(found, chucksPrius); + } + // @Test // public void testExampleAssociations() // { Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Address.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Address.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Address.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -36,7 +36,7 @@ * @author gcatania */ @Entity -public class Address +public class Address implements Cloneable { @Id @@ -293,4 +293,18 @@ + "]"; } + /** {@inheritDoc} */ + @Override + public Address clone() + { + try + { + return (Address) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Car.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Car.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Car.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -25,6 +25,7 @@ package it.openutils.hibernate.test.model; +import java.util.ArrayList; import java.util.Calendar; import java.util.List; @@ -34,6 +35,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; @@ -42,7 +44,7 @@ * @author gcatania */ @Entity -public class Car +public class Car implements Cloneable { @Id @@ -62,6 +64,8 @@ private CurrencyAmount marketValue; @OneToMany(cascade = CascadeType.ALL) + // join table appears problematic, using single join column instead + @JoinColumn(name = "carId", nullable = false) private List<Sticker> stickers; /** @@ -223,7 +227,7 @@ return false; } } - else if (!registrationDate.equals(other.registrationDate)) + else if (registrationDate.compareTo(other.registrationDate) != 0) { return false; } @@ -248,11 +252,9 @@ public String toString() { StringBuilder builder = new StringBuilder(); - builder - .append("Car [id=") - .append(id) - .append(", registrationDate=") - .append(registrationDate) + builder.append("Car [id=").append(id).append(", model=").append(model) + // .append(", registrationDate=") + // .append(registrationDate) .append(", marketValue=") .append(marketValue) .append(", stickers=") @@ -261,4 +263,36 @@ return builder.toString(); } + /** {@inheritDoc} */ + @Override + public Car clone() + { + Car clone; + try + { + clone = (Car) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + if (model != null) + { + clone.model = model.clone(); + } + if (registrationDate != null) + { + clone.registrationDate = (Calendar) registrationDate.clone(); + } + if (stickers != null) + { + clone.stickers = new ArrayList<Sticker>(); + for (Sticker s : stickers) + { + clone.stickers.add(s.clone()); + } + } + return clone; + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarMaker.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarMaker.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarMaker.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -25,6 +25,7 @@ package it.openutils.hibernate.test.model; +import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; @@ -38,7 +39,7 @@ * @author gcatania */ @Entity -public class CarMaker +public class CarMaker implements Cloneable { @Id @@ -206,4 +207,32 @@ return builder.toString(); } + /** {@inheritDoc} */ + @Override + public CarMaker clone() + { + CarMaker clone; + try + { + clone = (CarMaker) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + if (capitalization != null) + { + clone.capitalization = capitalization.clone(); + } + if (models != null) + { + clone.models = new ArrayList<CarModel>(); + for (CarModel m : models) + { + clone.models.add(m.clone()); + } + } + return clone; + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarModel.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarModel.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CarModel.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -38,7 +38,7 @@ * @author gcatania */ @Entity -public class CarModel +public class CarModel implements Cloneable { @Id @@ -217,4 +217,18 @@ return builder.toString(); } + /** {@inheritDoc} */ + @Override + public CarModel clone() + { + try + { + return (CarModel) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CurrencyAmount.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CurrencyAmount.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/CurrencyAmount.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -32,7 +32,7 @@ * @author gcatania */ @Embeddable -public class CurrencyAmount +public class CurrencyAmount implements Cloneable { private double amount; @@ -143,4 +143,17 @@ return new StringBuilder().append(currency).append(' ').append(amount).toString(); } + /** {@inheritDoc} */ + @Override + public CurrencyAmount clone() + { + try + { + return (CurrencyAmount) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + } } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Designer.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Designer.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Designer.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -25,6 +25,7 @@ package it.openutils.hibernate.test.model; +import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; @@ -130,4 +131,20 @@ return true; } + /** {@inheritDoc} */ + @Override + public Designer clone() + { + Designer clone = (Designer) super.clone(); + if (designedModels != null) + { + clone.designedModels = new HashSet<CarModel>(); + for (CarModel m : designedModels) + { + clone.designedModels.add(m.clone()); + } + } + return clone; + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Employee.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Employee.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Employee.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -190,7 +190,7 @@ return false; } } - else if (!employedSince.equals(other.employedSince)) + else if (employedSince.compareTo(other.employedSince) != 0) { return false; } @@ -230,4 +230,24 @@ return true; } + /** {@inheritDoc} */ + @Override + public Employee clone() + { + Employee clone = (Employee) super.clone(); + if (employer != null) + { + clone.employer = employer.clone(); + } + if (grossAnnualSalary != null) + { + clone.grossAnnualSalary = grossAnnualSalary.clone(); + } + if (employedSince != null) + { + clone.employedSince = (Calendar) employedSince.clone(); + } + return clone; + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/FullName.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/FullName.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/FullName.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -33,7 +33,7 @@ * @author gcatania */ @Embeddable -public class FullName +public class FullName implements Cloneable { private Title title; @@ -173,4 +173,18 @@ return "FullName [familyName=" + familyName + ", givenName=" + givenName + ", title=" + title + "]"; } + /** {@inheritDoc} */ + @Override + public FullName clone() + { + try + { + return (FullName) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Owner.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Owner.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Owner.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -25,6 +25,7 @@ package it.openutils.hibernate.test.model; +import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; @@ -125,4 +126,24 @@ return true; } + /** {@inheritDoc} */ + @Override + public Owner clone() + { + Owner clone = (Owner) super.clone(); + if (cars != null) + { + clone.cars = new HashSet<Car>(); + for (Car car : cars) + { + clone.cars.add(car.clone()); + } + } + if (totalValueOfCars != null) + { + clone.totalValueOfCars = totalValueOfCars.clone(); + } + return clone; + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Person.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Person.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Person.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -47,7 +47,7 @@ @Entity @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "personType") -public class Person +public class Person implements Cloneable { @Id @@ -188,7 +188,7 @@ return false; } } - else if (!birthDate.equals(other.birthDate)) + else if (birthDate.compareTo(other.birthDate) != 0) { return false; } @@ -257,4 +257,37 @@ return builder.toString(); } + /** {@inheritDoc} */ + @Override + public Person clone() + { + Person clone; + try + { + clone = (Person) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + + if (name != null) + { + clone.name = name.clone(); + } + if (birthDate != null) + { + clone.birthDate = (Calendar) birthDate.clone(); + } + if (currentAddress != null) + { + clone.currentAddress = currentAddress.clone(); + } + if (fiscalAddress != null) + { + clone.fiscalAddress = fiscalAddress.clone(); + } + return clone; + } + } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Sticker.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Sticker.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Sticker.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -35,7 +35,7 @@ * @author gcatania */ @Entity -public class Sticker +public class Sticker implements Cloneable { @Id @@ -216,4 +216,17 @@ return builder.toString(); } + /** {@inheritDoc} */ + @Override + public Sticker clone() + { + try + { + return (Sticker) super.clone(); + } + catch (CloneNotSupportedException e) + { + throw new InternalError(e.getMessage()); + } + } } Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Title.java =================================================================== --- branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Title.java 2012-06-22 15:56:05 UTC (rev 4071) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/model/Title.java 2012-06-22 15:59:20 UTC (rev 4072) @@ -28,9 +28,8 @@ /** * @author gcatania */ -public enum Title { - +public enum Title +{ /** male, female titles */ MR, MRS - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-06-22 15:56:11
|
Revision: 4071 http://openutils.svn.sourceforge.net/openutils/?rev=4071&view=rev Author: gcatania Date: 2012-06-22 15:56:05 +0000 (Fri, 22 Jun 2012) Log Message: ----------- Blocked revisions 4057 via svnmerge ........ r4057 | gcatania | 2012-06-06 23:28:38 +0200 (Wed, 06 Jun 2012) | 1 line BSHD-10 dependency update ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4057&view=rev Property Changed: ---------------- branches/openutils-bshd5-backport/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Modified: svnmerge-blocked - /trunk/openutils-bshd5:4041 + /trunk/openutils-bshd5:4041,4057 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |