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: <df...@us...> - 2012-05-25 16:17:04
|
Revision: 4051 http://openutils.svn.sourceforge.net/openutils/?rev=4051&view=rev Author: dfghi Date: 2012-05-25 16:16:57 +0000 (Fri, 25 May 2012) Log Message: ----------- CONTROLS-48 Backport 4049: Disabled insert/remove icons when the add rows is disabled (it means the number of rows is fixed). Modified Paths: -------------- magnoliamodules/branches/magnolia44/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl Modified: magnoliamodules/branches/magnolia44/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl =================================================================== --- magnoliamodules/branches/magnolia44/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl 2012-05-25 15:48:50 UTC (rev 4050) +++ magnoliamodules/branches/magnolia44/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl 2012-05-25 16:16:57 UTC (rev 4051) @@ -303,7 +303,8 @@ iconCls: 'button-insert-row', handler: function() { gridInsertRow(grid, ${(!addRowsEnabled)?string}); - } + }, + disabled: ${(!addRowsEnabled)?string} }, { text: '', tooltip: 'Remove row', @@ -311,7 +312,8 @@ iconCls: 'button-remove-row', handler: function() { gridRemoveRow(grid, ${(!addRowsEnabled)?string}); - } + }, + disabled: ${(!addRowsEnabled)?string} }], [#if (configuration.height??)] height: ${configuration.height}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <df...@us...> - 2012-05-25 15:48:57
|
Revision: 4050 http://openutils.svn.sourceforge.net/openutils/?rev=4050&view=rev Author: dfghi Date: 2012-05-25 15:48:50 +0000 (Fri, 25 May 2012) Log Message: ----------- CONTROLS-47 Extended combobox to prevent value display in some cases. Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java 2012-05-25 15:47:01 UTC (rev 4049) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java 2012-05-25 15:48:50 UTC (rev 4050) @@ -43,9 +43,20 @@ @Override public String getHeadSnippet() { - return "<script type=\"text/javascript\" src=\"" - + MgnlContext.getContextPath() - + "/.resources/controls/js/PipeComboBox.js\"></script>"; + StringBuilder result = new StringBuilder(super.getHeadSnippet()); + result.append("<script type=\"text/javascript\" src=\""); + result.append(MgnlContext.getContextPath()); + result.append("/.resources/controls/js/PipeComboBox.js\"></script>"); + // Combobox must be patched because of a bug. For reference, see: + // http://www.sencha.com/forum/showthread.php?17465-1.1.1-Local-ComboBox-data-store-filter-not-cleared-on-call-to-setValue%28%29 + result.append("var PatchedComboBox = Ext.extend(Ext.form.ComboBox, {"); + result.append(" setValue: function(v) {"); + result.append(" this.store.clearFilter();"); + result.append(" PatchedComboBox.superclass.setValue.call(this, v);"); + result.append(" }"); + result.append("});\n"); + result.append("</script>"); + return result.toString(); } /** @@ -89,7 +100,7 @@ column.put( "editor", "(function() { window.gridComboColumnTypeTmp = new " - + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "fm.ComboBox") + + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "PatchedComboBox") + "({" + StringUtils.join(options, ",") + "}); return new Ed(gridComboColumnTypeTmp); })()"); @@ -103,7 +114,7 @@ else { column.put("editor", "new Ed(new " - + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "fm.ComboBox") + + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "PatchedComboBox") + "({" + StringUtils.join(options, ",") + "}))"); Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js 2012-05-25 15:47:01 UTC (rev 4049) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js 2012-05-25 15:48:50 UTC (rev 4050) @@ -4,7 +4,14 @@ var v = PipeComboBox.superclass.getValue.call(this); return this.lastSelectionText + '|' + v; }, - + + // Combobox must be patched because of a bug. For reference, see: + // http://www.sencha.com/forum/showthread.php?17465-1.1.1-Local-ComboBox-data-store-filter-not-cleared-on-call-to-setValue%28%29 + setValue: function(v) { + this.store.clearFilter(); + PipeComboBox.superclass.setValue.call(this, v); + }, + findRecord : function(prop, value) { return PipeComboBox.superclass.findRecord.call(this, prop, value.replace(/^.*\|(.*)$/, '$1')); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <df...@us...> - 2012-05-25 15:47:08
|
Revision: 4049 http://openutils.svn.sourceforge.net/openutils/?rev=4049&view=rev Author: dfghi Date: 2012-05-25 15:47:01 +0000 (Fri, 25 May 2012) Log Message: ----------- CONTROLS-48 Disabled insert/remove icons when the add rows is disabled (it means the number of rows is fixed). Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl 2012-05-21 09:16:37 UTC (rev 4048) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl 2012-05-25 15:47:01 UTC (rev 4049) @@ -303,7 +303,8 @@ iconCls: 'button-insert-row', handler: function() { gridInsertRow(grid, ${(!addRowsEnabled)?string}); - } + }, + disabled: ${(!addRowsEnabled)?string} }, { text: '', tooltip: 'Remove row', @@ -311,7 +312,8 @@ iconCls: 'button-remove-row', handler: function() { gridRemoveRow(grid, ${(!addRowsEnabled)?string}); - } + }, + disabled: ${(!addRowsEnabled)?string} }], [#if (configuration.height??)] height: ${configuration.height}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-21 09:16:48
|
Revision: 4048 http://openutils.svn.sourceforge.net/openutils/?rev=4048&view=rev Author: gcatania Date: 2012-05-21 09:16:37 +0000 (Mon, 21 May 2012) Log Message: ----------- Merged revisions 4045-4047 via svnmerge from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 ........ r4045 | gcatania | 2012-05-21 10:48:00 +0200 (Mon, 21 May 2012) | 1 line BSHD-2 cleanup legacy example implementation ........ r4046 | gcatania | 2012-05-21 10:54:27 +0200 (Mon, 21 May 2012) | 1 line BSHD-2 source cleanup ........ r4047 | gcatania | 2012-05-21 11:03:05 +0200 (Mon, 21 May 2012) | 1 line dependency cleanup, updates ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4045&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4046&view=rev http://openutils.svn.sourceforge.net/openutils/?rev=4047&view=rev Modified Paths: -------------- branches/openutils-bshd5-backport/pom.xml branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Removed Paths: ------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/EnhancedExample.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-4039 + /trunk/openutils-bshd5:1-4040,4042-4047 Added: svn:mergeinfo + /trunk/openutils-bshd5:4045-4047* Modified: branches/openutils-bshd5-backport/pom.xml =================================================================== --- branches/openutils-bshd5-backport/pom.xml 2012-05-21 09:03:05 UTC (rev 4047) +++ branches/openutils-bshd5-backport/pom.xml 2012-05-21 09:16:37 UTC (rev 4048) @@ -72,17 +72,6 @@ </dependency> <dependency> <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> <exclusions> @@ -123,37 +112,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>${hibernate.annotations.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - <exclusion> - <groupId>avalon-framework</groupId> - <artifactId>avalon-framework</artifactId> - </exclusion> - <exclusion> - <groupId>logkit</groupId> - <artifactId>logkit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.8.0</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> @@ -164,7 +122,7 @@ <version>2.4</version> </dependency> <dependency> - <groupId>javassist</groupId> + <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>${javassist.version}</version> </dependency> @@ -190,7 +148,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>5.14.6</version> + <version>6.5.2</version> <scope>test</scope> </dependency> <dependency> @@ -199,11 +157,31 @@ <version>2.2.6</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>${hibernate.annotations.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <properties> <spring.version>2.5.5</spring.version> <hibernate.version>3.3.1.GA</hibernate.version> <hibernate.annotations.version>3.4.0.GA</hibernate.annotations.version> - <javassist.version>3.8.0.GA</javassist.version> + <javassist.version>3.14.0-GA</javassist.version> </properties> -</project> \ No newline at end of file +</project> Property changes on: branches/openutils-bshd5-backport/pom.xml ___________________________________________________________________ Added: svn:mergeinfo + /trunk/openutils-bshd5/pom.xml:4045-4047 Property changes on: branches/openutils-bshd5-backport/src ___________________________________________________________________ Added: svn:mergeinfo + /trunk/openutils-bshd5/src:4045-4047 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-05-21 09:03:05 UTC (rev 4047) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-21 09:16:37 UTC (rev 4048) @@ -37,6 +37,7 @@ import java.util.Map; import org.aopalliance.aop.AspectException; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.hibernate.Criteria; @@ -54,7 +55,6 @@ import org.springframework.aop.framework.AopContext; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.util.CollectionUtils; /** @@ -132,7 +132,6 @@ return (List<T>) getHibernateTemplate().execute(new HibernateCallback() { - @SuppressWarnings("unchecked") public List<T> doInHibernate(final Session ses) throws HibernateException { Criteria crit = ses.createCriteria(getReferenceClass()); @@ -158,7 +157,6 @@ /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") public List<T> find(String query) { return getHibernateTemplate().find(query); @@ -169,7 +167,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}); } /** @@ -180,7 +178,6 @@ return (List<T>) getHibernateTemplate().execute(new HibernateCallback() { - @SuppressWarnings("unchecked") public List<T> doInHibernate(final Session ses) throws HibernateException { // hibernate 3 @@ -346,7 +343,6 @@ /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") public K save(T obj) { return (K) getHibernateTemplate().save(obj); @@ -408,7 +404,6 @@ return (T) getHibernateTemplate().execute(new HibernateCallback() { - @SuppressWarnings("unchecked") public T doInHibernate(final Session ses) throws HibernateException { return (T) ses.merge(obj); @@ -561,7 +556,6 @@ return (List<Object>) getHibernateTemplate().execute(new HibernateCallback() { - @SuppressWarnings("unchecked") public List<Object> doInHibernate(final Session ses) throws HibernateException { Query q = ses.getNamedQuery(name); @@ -593,7 +587,6 @@ return (List<Object>) getHibernateTemplate().execute(new HibernateCallback() { - @SuppressWarnings("unchecked") public List<Object> doInHibernate(final Session ses) throws HibernateException { Query q = ses.getNamedQuery(name); @@ -706,7 +699,6 @@ /** * @return This is needed as for http://opensource.atlassian.com/projects/spring/browse/SPR-2226 */ - @SuppressWarnings("unchecked") private HibernateDAO<T, K> getThis() { try @@ -864,7 +856,6 @@ return crit; } - @SuppressWarnings("unchecked") public List<R> doInHibernate(Session session) throws HibernateException, SQLException { return createCriteria(session).list(); Deleted: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/EnhancedExample.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2012-05-21 09:03:05 UTC (rev 4047) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2012-05-21 09:16:37 UTC (rev 4048) @@ -1,337 +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.example; - -import java.lang.reflect.InvocationTargetException; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Calendar; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.commons.lang.ClassUtils; -import org.apache.commons.lang.StringUtils; -import org.hibernate.Criteria; -import org.hibernate.HibernateException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.dao.DataRetrievalFailureException; - - -/** - * @deprecated this example implementation does not take into account hibernate metadata, see BSHD-5. Use ExampleTree - * instead - * @author Fabrizio Giustina - * @version $Id: $ - */ -@Deprecated -public final class EnhancedExample -{ - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(EnhancedExample.class); - - private Map<String, ? extends FilterMetadata> metadata; - - private EnhancedExample( - final Criteria crit, - final Object filter, - final Map<String, ? extends FilterMetadata> metadata) - { - this.metadata = metadata == null ? Collections.<String, FilterMetadata> emptyMap() : metadata; - fillCriteria(null, crit, filter); - } - - /** - * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. - * @param crit Criteria - * @param filter javabean which will be analyzed for non-null properties - * @param metadata Map of property names - filter metadata - * @throws HibernateException exception while building the criteria - */ - public static void create(final Criteria crit, final Object filter, - final Map<String, ? extends FilterMetadata> metadata) throws HibernateException - { - new EnhancedExample(crit, filter, metadata); - } - - /** - * Adds contitions to an existing criteria or create sub-criteria for associations. - * @param crit Criteria - * @param propertyName property name in parent bean - * @param value property value - * @throws HibernateException exception while building the criteria - */ - private void addCondition(final Criteria crit, final String propertyName, final Object value, - final Object parentObject) throws HibernateException - { - - String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast( - propertyName, - ".") : propertyName; - - if (isSimpleType(value) || value.getClass().isEnum()) - { - - // don't filter on empty strings! - if (value instanceof String && StringUtils.isBlank((String) value)) - { - return; - } - - FilterMetadata fmd = metadata.get(propertyName); - - if (fmd == null) - { - fmd = FilterMetadata.EQUAL; - } - - fmd.createFilter(crit, simplePropertyName, value); - - } - else - { - if (containsSomething(value)) - { - // @todo handle multiple associations in lists? - // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 - if ((value instanceof Set< ? > || value instanceof List< ? >) && !((Collection< ? >) value).isEmpty()) - { - // collection: the new criteria has already been created, now we only need to analize content - - for (Object element : ((Collection< ? >) value)) - { - - log.debug("crit.createCriteria({})", simplePropertyName); - Criteria childrenCriteria = crit.createCriteria(simplePropertyName); - fillCriteria(propertyName, childrenCriteria, element); - } - } - else if ((value instanceof Map< ? , ? >) && !((Map< ? , ? >) value).isEmpty()) - { - FilterMetadata fmd = metadata.get(propertyName); - - if (fmd != null) - { - fmd.createFilter(crit, simplePropertyName, value); - } - else - { - log.warn( - "Maps are not handled without a FilterMetadata. Property is {} and value is {}.", - propertyName, - value); - } - } - else - { - log.debug("crit.createCriteria({})", simplePropertyName); - Criteria childrenCriteria = crit.createCriteria(simplePropertyName); - fillCriteria(propertyName, childrenCriteria, value); - } - } - } - } - - /** - * Check if the bean contains at least a valid property. - * @param bean javabean - * @return <code>true</code> if the bean contains at least a valid property - */ - @SuppressWarnings("unchecked") - private boolean containsSomething(final Object bean) - { - - if (bean == null) - { - return false; - } - if (isSimpleType(bean) || bean.getClass().isEnum()) - { - return true; - } - - if (bean instanceof Collection< ? >) - { - - Collection< ? > coll = ((Collection< ? >) bean); - if (coll.isEmpty()) - { - return false; - } - - if (containsSomething(coll.iterator().next())) - { - return true; - } - } - else if (bean instanceof Map< ? , ? >) - { - Map< ? , ? > coll = ((Map< ? , ? >) bean); - if (coll.isEmpty()) - { - return false; - } - - if (containsSomething(coll.values().iterator().next())) - { - return true; - } - } - - Map<String, Object> properties; - try - { - properties = PropertyUtils.describe(bean); - } - catch (Throwable e) - { - if (e instanceof InvocationTargetException) - { - e = ((InvocationTargetException) e).getTargetException(); - } - - log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class " - + ClassUtils.getShortClassName(bean, "NULL"), e); - return false; - } - - for (Map.Entry<String, Object> property : properties.entrySet()) - { - - if (!PropertyUtils.isWriteable(bean, property.getKey())) - { - // skip readonly properties - continue; - } - - Object propertyValue = property.getValue(); - if (propertyValue == null) - { - continue; - } - - if (isSimpleType(propertyValue) || containsSomething(propertyValue)) - { - return true; - } - } - - return false; - } - - /** - * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. - * @param crit Criteria - * @param filter javabean which will be analyzed for non-null properties - * @throws HibernateException exception while building the criteria - */ - @SuppressWarnings("unchecked") - private void fillCriteria(final String parentPropertyName, final Criteria crit, final Object filter) - throws HibernateException - { - if ((filter instanceof Set< ? > || filter instanceof List< ? >) && !((Collection< ? >) filter).isEmpty()) - { - // collection: the new criteria has already been created, now we only need to analize content - for (Object element : ((Collection< ? >) filter)) - { - fillCriteria(parentPropertyName, crit, element); - } - } - - Map<String, Object> properties; - try - { - properties = PropertyUtils.describe(filter); - } - catch (Throwable e) - { - if (e instanceof InvocationTargetException) - { - e = ((InvocationTargetException) e).getTargetException(); - } - - throw new DataRetrievalFailureException( - "Unable to build filter, PropertyUtils.describe throws an exception while analizing class " - + ClassUtils.getShortClassName(filter, "NULL") - + ":" - + e.getClass(), - e); - } - - Iterator<String> iterator = properties.keySet().iterator(); - while (iterator.hasNext()) - { - String propertyName = iterator.next(); - - Object value = properties.get(propertyName); - - // add only non-null values, ignore read-only properties - if (value != null && PropertyUtils.isWriteable(filter, propertyName)) - { - String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName - + "." - + propertyName; - addCondition(crit, composedPropertyName, value, filter); - } - } - } - - /** - * Check if the given object is a simple java type - * @param object object to check - * @return <code>true</code>if the given object is a simple type - */ - private boolean isSimpleType(final Object object) - { - - Class< ? extends Object> objClass = object.getClass(); - - return objClass.isPrimitive() - || objClass.equals(Integer.class) - || objClass.equals(Long.class) - || objClass.equals(Short.class) - || objClass.equals(Boolean.class) - || objClass.equals(String.class) - || objClass.equals(Double.class) - || objClass.equals(Float.class) - || objClass.equals(Date.class) - || objClass.equals(Byte.class) - || objClass.equals(BigDecimal.class) - || objClass.equals(Timestamp.class) - || objClass.equals(Character.class) - || Calendar.class.isAssignableFrom(objClass); - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-21 09:03:15
|
Revision: 4047 http://openutils.svn.sourceforge.net/openutils/?rev=4047&view=rev Author: gcatania Date: 2012-05-21 09:03:05 +0000 (Mon, 21 May 2012) Log Message: ----------- dependency cleanup, updates Modified Paths: -------------- trunk/openutils-bshd5/pom.xml Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2012-05-21 08:54:27 UTC (rev 4046) +++ trunk/openutils-bshd5/pom.xml 2012-05-21 09:03:05 UTC (rev 4047) @@ -61,28 +61,6 @@ </dependency> <dependency> <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> <exclusions> @@ -123,37 +101,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.5.6-Final</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - <exclusion> - <groupId>avalon-framework</groupId> - <artifactId>avalon-framework</artifactId> - </exclusion> - <exclusion> - <groupId>logkit</groupId> - <artifactId>logkit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.7.0</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> @@ -164,9 +111,9 @@ <version>2.4</version> </dependency> <dependency> - <groupId>javassist</groupId> + <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> - <version>3.4.GA</version> + <version>3.16.1-GA</version> </dependency> <!-- test dependencies --> <dependency> @@ -184,8 +131,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>5.7</version> - <classifier>jdk15</classifier> + <version>6.5.2</version> <scope>test</scope> </dependency> <dependency> @@ -194,8 +140,28 @@ <version>2.2.6</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.5.6-Final</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <properties> <spring.version>3.0.0.RELEASE</spring.version> </properties> -</project> \ No newline at end of file +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-21 08:54:38
|
Revision: 4046 http://openutils.svn.sourceforge.net/openutils/?rev=4046&view=rev Author: gcatania Date: 2012-05-21 08:54:27 +0000 (Mon, 21 May 2012) Log Message: ----------- BSHD-2 source cleanup 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-05-21 08:48:00 UTC (rev 4045) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-21 08:54:27 UTC (rev 4046) @@ -37,6 +37,7 @@ import java.util.Map; import org.aopalliance.aop.AspectException; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.hibernate.Criteria; @@ -54,7 +55,6 @@ import org.springframework.aop.framework.AopContext; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.util.CollectionUtils; /** @@ -131,7 +131,6 @@ return getHibernateTemplate().execute(new HibernateCallback<List<T>>() { - @SuppressWarnings("unchecked") public List<T> doInHibernate(final Session ses) throws HibernateException { Criteria crit = ses.createCriteria(getReferenceClass()); @@ -157,7 +156,6 @@ /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") public List<T> find(String query) { return getHibernateTemplate().find(query); @@ -168,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}); } /** @@ -179,7 +177,6 @@ return getHibernateTemplate().execute(new HibernateCallback<List<T>>() { - @SuppressWarnings("unchecked") public List<T> doInHibernate(final Session ses) throws HibernateException { // hibernate 3 @@ -345,7 +342,6 @@ /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") public K save(T obj) { return (K) getHibernateTemplate().save(obj); @@ -407,7 +403,6 @@ return getHibernateTemplate().execute(new HibernateCallback<T>() { - @SuppressWarnings("unchecked") public T doInHibernate(final Session ses) throws HibernateException { return (T) ses.merge(obj); @@ -560,7 +555,6 @@ return getHibernateTemplate().execute(new HibernateCallback<List<Object>>() { - @SuppressWarnings("unchecked") public List<Object> doInHibernate(final Session ses) throws HibernateException { Query q = ses.getNamedQuery(name); @@ -592,7 +586,6 @@ return getHibernateTemplate().execute(new HibernateCallback<List<Object>>() { - @SuppressWarnings("unchecked") public List<Object> doInHibernate(final Session ses) throws HibernateException { Query q = ses.getNamedQuery(name); @@ -705,7 +698,6 @@ /** * @return This is needed as for http://opensource.atlassian.com/projects/spring/browse/SPR-2226 */ - @SuppressWarnings("unchecked") private HibernateDAO<T, K> getThis() { try @@ -863,7 +855,6 @@ return crit; } - @SuppressWarnings("unchecked") public List<R> doInHibernate(Session session) throws HibernateException, SQLException { return createCriteria(session).list(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-21 08:48:11
|
Revision: 4045 http://openutils.svn.sourceforge.net/openutils/?rev=4045&view=rev Author: gcatania Date: 2012-05-21 08:48:00 +0000 (Mon, 21 May 2012) Log Message: ----------- BSHD-2 cleanup legacy example implementation Removed Paths: ------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java Deleted: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2012-05-20 16:49:05 UTC (rev 4044) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2012-05-21 08:48:00 UTC (rev 4045) @@ -1,337 +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.example; - -import java.lang.reflect.InvocationTargetException; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Calendar; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.commons.lang.ClassUtils; -import org.apache.commons.lang.StringUtils; -import org.hibernate.Criteria; -import org.hibernate.HibernateException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.dao.DataRetrievalFailureException; - - -/** - * @deprecated this example implementation does not take into account hibernate metadata, see BSHD-5. Use ExampleTree - * instead - * @author Fabrizio Giustina - * @version $Id: $ - */ -@Deprecated -public final class EnhancedExample -{ - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(EnhancedExample.class); - - private Map<String, ? extends FilterMetadata> metadata; - - private EnhancedExample( - final Criteria crit, - final Object filter, - final Map<String, ? extends FilterMetadata> metadata) - { - this.metadata = metadata == null ? Collections.<String, FilterMetadata> emptyMap() : metadata; - fillCriteria(null, crit, filter); - } - - /** - * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. - * @param crit Criteria - * @param filter javabean which will be analyzed for non-null properties - * @param metadata Map of property names - filter metadata - * @throws HibernateException exception while building the criteria - */ - public static void create(final Criteria crit, final Object filter, - final Map<String, ? extends FilterMetadata> metadata) throws HibernateException - { - new EnhancedExample(crit, filter, metadata); - } - - /** - * Adds contitions to an existing criteria or create sub-criteria for associations. - * @param crit Criteria - * @param propertyName property name in parent bean - * @param value property value - * @throws HibernateException exception while building the criteria - */ - private void addCondition(final Criteria crit, final String propertyName, final Object value, - final Object parentObject) throws HibernateException - { - - String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast( - propertyName, - ".") : propertyName; - - if (isSimpleType(value) || value.getClass().isEnum()) - { - - // don't filter on empty strings! - if (value instanceof String && StringUtils.isBlank((String) value)) - { - return; - } - - FilterMetadata fmd = metadata.get(propertyName); - - if (fmd == null) - { - fmd = FilterMetadata.EQUAL; - } - - fmd.createFilter(crit, simplePropertyName, value); - - } - else - { - if (containsSomething(value)) - { - // @todo handle multiple associations in lists? - // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 - if ((value instanceof Set< ? > || value instanceof List< ? >) && !((Collection< ? >) value).isEmpty()) - { - // collection: the new criteria has already been created, now we only need to analize content - - for (Object element : ((Collection< ? >) value)) - { - - log.debug("crit.createCriteria({})", simplePropertyName); - Criteria childrenCriteria = crit.createCriteria(simplePropertyName); - fillCriteria(propertyName, childrenCriteria, element); - } - } - else if ((value instanceof Map< ? , ? >) && !((Map< ? , ? >) value).isEmpty()) - { - FilterMetadata fmd = metadata.get(propertyName); - - if (fmd != null) - { - fmd.createFilter(crit, simplePropertyName, value); - } - else - { - log.warn( - "Maps are not handled without a FilterMetadata. Property is {} and value is {}.", - propertyName, - value); - } - } - else - { - log.debug("crit.createCriteria({})", simplePropertyName); - Criteria childrenCriteria = crit.createCriteria(simplePropertyName); - fillCriteria(propertyName, childrenCriteria, value); - } - } - } - } - - /** - * Check if the bean contains at least a valid property. - * @param bean javabean - * @return <code>true</code> if the bean contains at least a valid property - */ - @SuppressWarnings("unchecked") - private boolean containsSomething(final Object bean) - { - - if (bean == null) - { - return false; - } - if (isSimpleType(bean) || bean.getClass().isEnum()) - { - return true; - } - - if (bean instanceof Collection< ? >) - { - - Collection< ? > coll = ((Collection< ? >) bean); - if (coll.isEmpty()) - { - return false; - } - - if (containsSomething(coll.iterator().next())) - { - return true; - } - } - else if (bean instanceof Map< ? , ? >) - { - Map< ? , ? > coll = ((Map< ? , ? >) bean); - if (coll.isEmpty()) - { - return false; - } - - if (containsSomething(coll.values().iterator().next())) - { - return true; - } - } - - Map<String, Object> properties; - try - { - properties = PropertyUtils.describe(bean); - } - catch (Throwable e) - { - if (e instanceof InvocationTargetException) - { - e = ((InvocationTargetException) e).getTargetException(); - } - - log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class " - + ClassUtils.getShortClassName(bean, "NULL"), e); - return false; - } - - for (Map.Entry<String, Object> property : properties.entrySet()) - { - - if (!PropertyUtils.isWriteable(bean, property.getKey())) - { - // skip readonly properties - continue; - } - - Object propertyValue = property.getValue(); - if (propertyValue == null) - { - continue; - } - - if (isSimpleType(propertyValue) || containsSomething(propertyValue)) - { - return true; - } - } - - return false; - } - - /** - * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. - * @param crit Criteria - * @param filter javabean which will be analyzed for non-null properties - * @throws HibernateException exception while building the criteria - */ - @SuppressWarnings("unchecked") - private void fillCriteria(final String parentPropertyName, final Criteria crit, final Object filter) - throws HibernateException - { - if ((filter instanceof Set< ? > || filter instanceof List< ? >) && !((Collection< ? >) filter).isEmpty()) - { - // collection: the new criteria has already been created, now we only need to analize content - for (Object element : ((Collection< ? >) filter)) - { - fillCriteria(parentPropertyName, crit, element); - } - } - - Map<String, Object> properties; - try - { - properties = PropertyUtils.describe(filter); - } - catch (Throwable e) - { - if (e instanceof InvocationTargetException) - { - e = ((InvocationTargetException) e).getTargetException(); - } - - throw new DataRetrievalFailureException( - "Unable to build filter, PropertyUtils.describe throws an exception while analizing class " - + ClassUtils.getShortClassName(filter, "NULL") - + ":" - + e.getClass(), - e); - } - - Iterator<String> iterator = properties.keySet().iterator(); - while (iterator.hasNext()) - { - String propertyName = iterator.next(); - - Object value = properties.get(propertyName); - - // add only non-null values, ignore read-only properties - if (value != null && PropertyUtils.isWriteable(filter, propertyName)) - { - String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName - + "." - + propertyName; - addCondition(crit, composedPropertyName, value, filter); - } - } - } - - /** - * Check if the given object is a simple java type - * @param object object to check - * @return <code>true</code>if the given object is a simple type - */ - private boolean isSimpleType(final Object object) - { - - Class< ? extends Object> objClass = object.getClass(); - - return objClass.isPrimitive() - || objClass.equals(Integer.class) - || objClass.equals(Long.class) - || objClass.equals(Short.class) - || objClass.equals(Boolean.class) - || objClass.equals(String.class) - || objClass.equals(Double.class) - || objClass.equals(Float.class) - || objClass.equals(Date.class) - || objClass.equals(Byte.class) - || objClass.equals(BigDecimal.class) - || objClass.equals(Timestamp.class) - || objClass.equals(Character.class) - || Calendar.class.isAssignableFrom(objClass); - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 16:49:12
|
Revision: 4044 http://openutils.svn.sourceforge.net/openutils/?rev=4044&view=rev Author: gcatania Date: 2012-05-20 16:49:05 +0000 (Sun, 20 May 2012) Log Message: ----------- backport: method signature compatibility Modified Paths: -------------- branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java =================================================================== --- branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2012-05-20 14:44:39 UTC (rev 4043) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2012-05-20 16:49:05 UTC (rev 4044) @@ -203,7 +203,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata); + List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata); /** * Retrieve the entities handled by this DAO whose property values match, via <code>equals()</code> or via a @@ -220,7 +220,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page); + List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata, int maxResults, int page); /** * Retrieve the entities handled by this DAO whose property values match, via <code>equals()</code> or via a @@ -239,8 +239,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, - Order... orders); + List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata, int maxResults, int page, Order... orders); /** * Retrieve the entities handled by this DAO whose property values match, via <code>equals()</code> or via a @@ -260,8 +259,8 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, - List< ? extends Criterion> criteria, Order... orders); + List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata, int maxResults, int page, + List<Criterion> criteria, Order... orders); /** * Retrieve the first entity instance that matches the input <code>filter</code>, if existing. @@ -305,7 +304,7 @@ * @return the first matching instance of the entity class managed by this DAO, or <code>null</code> if none found * @see #findFiltered(T, List) */ - T findFilteredFirst(T filter, List< ? extends Criterion> criteria); + T findFilteredFirst(T filter, List<Criterion> criteria); /** * Load object matching the given key and return it. Throw an exception if not found. @@ -401,7 +400,7 @@ * @deprecated use the correctly named {@link #find(Order[], List)} instead */ @Deprecated - List<T> findAll(Order[] orderProperties, List< ? extends Criterion> criteria); + List<T> findAll(Order[] orderProperties, List<Criterion> criteria); /** * Retrieve the entities handled by this DAO whose property values match, via <code>equals()</code> or via a @@ -420,8 +419,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<T> findFiltered(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, - int page); + List<T> findFiltered(T filter, Order[] orders, Map<String, FilterMetadata> metadata, int maxResults, int page); /** * Retrieve the entities handled by this DAO whose property values match, via <code>equals()</code> or via a @@ -441,8 +439,8 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<T> findFiltered(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, - int page, List< ? extends Criterion> criteria); + List<T> findFiltered(T filter, Order[] orders, Map<String, FilterMetadata> metadata, int maxResults, int page, + List<Criterion> criteria); /** * Retrieve a set of properties from the entities returned by @@ -462,7 +460,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<Object> findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, - int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties); + List<Object> findFilteredProperties(T filter, Order[] orders, Map<String, FilterMetadata> metadata, int maxResults, + int page, List<Criterion> criteria, List<String> properties); } 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-05-20 14:44:39 UTC (rev 4043) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-20 16:49:05 UTC (rev 4044) @@ -242,7 +242,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata) + public List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata) { return getThis().findFiltered( filter, @@ -258,7 +258,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page) + public List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata, int maxResults, int page) { return getThis().findFiltered( filter, @@ -304,7 +304,7 @@ /** * {@inheritDoc} */ - public T findFilteredFirst(T filter, List< ? extends Criterion> criteria) + public T findFilteredFirst(T filter, List<Criterion> criteria) { ExampleTree exampleTree = new ExampleTree(filter); appendToRoot(exampleTree, criteria); @@ -421,7 +421,7 @@ * {@inheritDoc} */ @Deprecated - public List<T> findAll(Order[] orders, List< ? extends Criterion> criteria) + public List<T> findAll(Order[] orders, List<Criterion> criteria) { return getThis().find(criteria, orders); } @@ -459,8 +459,8 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<T> findFiltered(T filter, Order[] customOrder, Map<String, ? extends FilterMetadata> metadata, - int maxResults, int page) + public List<T> findFiltered(T filter, Order[] customOrder, Map<String, FilterMetadata> metadata, int maxResults, + int page) { return getThis().findFiltered( filter, @@ -476,7 +476,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, + public List<T> findFiltered(T filter, Map<String, FilterMetadata> metadata, int maxResults, int page, Order... orders) { return getThis().findFiltered(filter, metadata, maxResults, page, Collections.<Criterion> emptyList(), orders); @@ -487,8 +487,8 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, - List< ? extends Criterion> criteria, Order... orders) + 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)); @@ -499,8 +499,8 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<T> findFiltered(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, - int maxResults, int page, List< ? extends Criterion> criteria) + public List<T> findFiltered(T filter, Order[] orders, Map<String, FilterMetadata> metadata, int maxResults, + int page, List<Criterion> criteria) { return getThis().findFiltered(filter, metadata, maxResults, page, criteria, orders); } @@ -510,9 +510,8 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<Object> findFilteredProperties(T filter, Order[] orders, - Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, - List<String> properties) + public List<Object> 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)); @@ -667,7 +666,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - protected Map<String, ? extends FilterMetadata> getDefaultFilterMetadata() + protected Map<String, FilterMetadata> getDefaultFilterMetadata() { return Collections.emptyMap(); } @@ -738,7 +737,7 @@ private final T rootEntity; - private final Map<String, ? extends FilterMetadata> filterMetadata; + private final Map<String, FilterMetadata> filterMetadata; private final List< ? extends Criterion> additionalCriteria; @@ -746,7 +745,7 @@ T rootEntity, int maxResults, int page, - Map<String, ? extends FilterMetadata> metadata, + Map<String, FilterMetadata> metadata, List< ? extends Criterion> additionalCriteria, Order... orders) { @@ -789,7 +788,7 @@ T rootEntity, int maxResults, int page, - Map<String, ? extends FilterMetadata> metadata, + Map<String, FilterMetadata> metadata, List< ? extends Criterion> additionalCriteria, List<String> properties, Order... orders) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 14:44:45
|
Revision: 4043 http://openutils.svn.sourceforge.net/openutils/?rev=4043&view=rev Author: gcatania Date: 2012-05-20 14:44:39 +0000 (Sun, 20 May 2012) Log Message: ----------- Blocked revisions 4041 via svnmerge ........ r4041 | gcatania | 2012-05-20 16:42:04 +0200 (Sun, 20 May 2012) | 1 line snapshot version bump ........ Revision Links: -------------- http://openutils.svn.sourceforge.net/openutils/?rev=4041&view=rev Property Changed: ---------------- branches/openutils-bshd5-backport/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Added: svnmerge-blocked + /trunk/openutils-bshd5:4041 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 14:42:20
|
Revision: 4042 http://openutils.svn.sourceforge.net/openutils/?rev=4042&view=rev Author: gcatania Date: 2012-05-20 14:42:14 +0000 (Sun, 20 May 2012) Log Message: ----------- version bump Modified Paths: -------------- branches/openutils-bshd5-backport/pom.xml Modified: branches/openutils-bshd5-backport/pom.xml =================================================================== --- branches/openutils-bshd5-backport/pom.xml 2012-05-20 14:42:04 UTC (rev 4041) +++ branches/openutils-bshd5-backport/pom.xml 2012-05-20 14:42:14 UTC (rev 4042) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-bshd5</artifactId> <name>openutils base Spring-Hibernate DAO</name> - <version>2.1.1-SNAPSHOT</version> + <version>2.5.0-SNAPSHOT</version> <description>Openutils base Spring-Hibernate DAO (for java 5 and more)</description> <licenses> <license> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 14:42:10
|
Revision: 4041 http://openutils.svn.sourceforge.net/openutils/?rev=4041&view=rev Author: gcatania Date: 2012-05-20 14:42:04 +0000 (Sun, 20 May 2012) Log Message: ----------- snapshot version bump Modified Paths: -------------- trunk/openutils-bshd5/pom.xml Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2012-05-20 14:40:23 UTC (rev 4040) +++ trunk/openutils-bshd5/pom.xml 2012-05-20 14:42:04 UTC (rev 4041) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-bshd5</artifactId> <name>openutils base Spring-Hibernate DAO</name> - <version>2.1.1-SNAPSHOT</version> + <version>3.0.0-SNAPSHOT</version> <description>Openutils base Spring-Hibernate DAO (for java 5 and more)</description> <licenses> <license> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 14:40:29
|
Revision: 4040 http://openutils.svn.sourceforge.net/openutils/?rev=4040&view=rev Author: gcatania Date: 2012-05-20 14:40:23 +0000 (Sun, 20 May 2012) Log Message: ----------- Initialized merge tracking via "svnmerge" with revisions "1-4039" from https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-bshd5 Property Changed: ---------------- branches/openutils-bshd5-backport/ Property changes on: branches/openutils-bshd5-backport ___________________________________________________________________ Added: svnmerge-integrated + /trunk/openutils-bshd5:1-4039 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 14:27:39
|
Revision: 4039 http://openutils.svn.sourceforge.net/openutils/?rev=4039&view=rev Author: gcatania Date: 2012-05-20 14:27:33 +0000 (Sun, 20 May 2012) Log Message: ----------- backport branch for bshd5 Modified Paths: -------------- branches/openutils-bshd5-backport/pom.xml 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/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java Added Paths: ----------- branches/openutils-bshd5-backport/ Modified: branches/openutils-bshd5-backport/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2012-05-20 14:13:06 UTC (rev 4038) +++ branches/openutils-bshd5-backport/pom.xml 2012-05-20 14:27:33 UTC (rev 4039) @@ -106,7 +106,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> - <version>3.5.6-Final</version> + <version>${hibernate.version}</version> <exclusions> <exclusion> <groupId>cglib</groupId> @@ -125,7 +125,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> - <version>3.5.6-Final</version> + <version>${hibernate.annotations.version}</version> <scope>test</scope> <exclusions> <exclusion> @@ -145,7 +145,7 @@ <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> - <version>1.7.0</version> + <version>1.8.0</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -166,7 +166,7 @@ <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> - <version>3.4.GA</version> + <version>${javassist.version}</version> </dependency> <!-- test dependencies --> <dependency> @@ -180,12 +180,17 @@ <artifactId>spring-test</artifactId> <version>${spring.version}</version> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>5.7</version> - <classifier>jdk15</classifier> + <version>5.14.6</version> <scope>test</scope> </dependency> <dependency> @@ -196,6 +201,9 @@ </dependency> </dependencies> <properties> - <spring.version>3.0.0.RELEASE</spring.version> + <spring.version>2.5.5</spring.version> + <hibernate.version>3.3.1.GA</hibernate.version> + <hibernate.annotations.version>3.4.0.GA</hibernate.annotations.version> + <javassist.version>3.8.0.GA</javassist.version> </properties> </project> \ No newline at end of file Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-20 14:13:06 UTC (rev 4038) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-20 14:27:33 UTC (rev 4039) @@ -64,6 +64,7 @@ * @param <T> Persistence class * @param <K> Object Key */ +@SuppressWarnings("unchecked") public abstract class HibernateDAOImpl<T, K extends Serializable> extends HibernateDaoSupport implements HibernateDAO<T, K> @@ -128,7 +129,7 @@ */ public List<T> find(final List< ? extends Criterion> criteria, final Order... orders) { - return getHibernateTemplate().execute(new HibernateCallback<List<T>>() + return (List<T>) getHibernateTemplate().execute(new HibernateCallback() { @SuppressWarnings("unchecked") @@ -176,7 +177,7 @@ */ public List<T> find(final String query, final Object[] paramValues, final Type[] paramTypes) { - return getHibernateTemplate().execute(new HibernateCallback<List<T>>() + return (List<T>) getHibernateTemplate().execute(new HibernateCallback() { @SuppressWarnings("unchecked") @@ -315,7 +316,7 @@ */ public T load(K key) { - T result = getHibernateTemplate().load(getReferenceClass(), key); + T result = (T) getHibernateTemplate().load(getReferenceClass(), key); Hibernate.initialize(result); return result; } @@ -325,7 +326,7 @@ */ public T loadIfAvailable(K key) { - T result = getHibernateTemplate().get(getReferenceClass(), key); + T result = (T) getHibernateTemplate().get(getReferenceClass(), key); if (result != null) { Hibernate.initialize(result); @@ -339,7 +340,7 @@ */ public T get(K key) { - return getHibernateTemplate().get(getReferenceClass(), key); + return (T) getHibernateTemplate().get(getReferenceClass(), key); } /** @@ -372,7 +373,7 @@ */ public boolean delete(final K key) { - return getHibernateTemplate().execute(new HibernateCallback<Boolean>() + return (Boolean) getHibernateTemplate().execute(new HibernateCallback() { public Boolean doInHibernate(final Session ses) throws HibernateException @@ -404,7 +405,7 @@ */ public T merge(final T obj) { - return getHibernateTemplate().execute(new HibernateCallback<T>() + return (T) getHibernateTemplate().execute(new HibernateCallback() { @SuppressWarnings("unchecked") @@ -430,7 +431,8 @@ */ public List<T> findFiltered(ExampleTree exampleTree, int maxResults, int page, Order... orders) { - return getHibernateTemplate().execute(new ExampleTreeCallback<T>(exampleTree, maxResults, page, orders)); + return (List<T>) getHibernateTemplate().execute( + new ExampleTreeCallback<T>(exampleTree, maxResults, page, orders)); } /** @@ -448,7 +450,7 @@ public List<Object> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, List<String> properties, Order... orders) { - return getHibernateTemplate().execute( + return (List<Object>) getHibernateTemplate().execute( new ExampleTreePropertiesCallback(exampleTree, maxResults, page, properties, orders)); } @@ -488,7 +490,7 @@ public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, Order... orders) { - return getHibernateTemplate().execute( + return (List<T>) getHibernateTemplate().execute( new LegacySupportCallback<T>(filter, maxResults, page, metadata, criteria, orders)); } @@ -512,7 +514,7 @@ Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties) { - return getHibernateTemplate().execute( + return (List<Object>) getHibernateTemplate().execute( new LegacySupportPropertiesCallback(filter, maxResults, page, metadata, criteria, properties, orders)); } @@ -557,7 +559,7 @@ */ protected List<Object> findByNamedQuery(final String name, final Serializable[] params, final Integer maxResults) { - return getHibernateTemplate().execute(new HibernateCallback<List<Object>>() + return (List<Object>) getHibernateTemplate().execute(new HibernateCallback() { @SuppressWarnings("unchecked") @@ -589,7 +591,7 @@ */ protected List<Object> findByNamedQuery(final String name, final Map<String, ? > params, final Integer maxResults) { - return getHibernateTemplate().execute(new HibernateCallback<List<Object>>() + return (List<Object>) getHibernateTemplate().execute(new HibernateCallback() { @SuppressWarnings("unchecked") @@ -821,7 +823,7 @@ * @author gcatania * @param R the result class */ -class ExampleTreeCallback<R> implements HibernateCallback<List<R>> +class ExampleTreeCallback<R> implements HibernateCallback { private final Order[] orders; Modified: branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-05-20 14:13:06 UTC (rev 4038) +++ branches/openutils-bshd5-backport/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-05-20 14:27:33 UTC (rev 4039) @@ -323,7 +323,8 @@ // TODO is this cast really necessary? Will it fail in future hibernate versions? SessionImplementor si = (SessionImplementor) sessionFactory.getCurrentSession(); - Object idValue = classMetadata.getIdentifier(entity, si); + // Object idValue = classMetadata.getIdentifier(entity, si); + Object idValue = classMetadata.getIdentifier(entity, entityMode); if (idValue != null) // TODO should we use property selectors instead? { crit.add(Restrictions.idEq(idValue)); Modified: branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java =================================================================== --- trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-05-20 14:13:06 UTC (rev 4038) +++ branches/openutils-bshd5-backport/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-05-20 14:27:33 UTC (rev 4039) @@ -420,6 +420,29 @@ Assert.assertEquals(found.size(), 2); } + /** + * warning: in this hibernate version, retrieval of component properties appears to be problematic: + * + * <pre> + * org.hibernate.QueryException: property does not map to a single column: name + * at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumn(CriteriaQueryTranslator.java:394) + * at org.hibernate.criterion.PropertyProjection.toSqlString(PropertyProjection.java:64) + * at org.hibernate.criterion.ProjectionList.toSqlString(ProjectionList.java:72) + * at org.hibernate.loader.criteria.CriteriaQueryTranslator.getSelect(CriteriaQueryTranslator.java:333) + * at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:102) + * at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:82) + * at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:91) + * at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1577) + * at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306) + * at it.openutils.dao.hibernate.ExampleTreeCallback.doInHibernate(HibernateDAOImpl.java:871) + * at it.openutils.dao.hibernate.ExampleTreeCallback.doInHibernate(HibernateDAOImpl.java:826) + * at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) + * ... 42 more + * </pre> + * + * for this reason, component properties have been commented out of the test. More info here: + * https://forum.hibernate.org/viewtopic.php?f=1&t=974762 + */ @Test public void testFindFilteredProperties() { @@ -438,27 +461,27 @@ filter, Integer.MAX_VALUE, 0, - Collections.singletonList("fiscalAddress")); + Collections.singletonList("birthDate")); Assert.assertEquals(foundProperties.size(), 2); - Assert.assertEquals(foundProperties.get(0), alice.getFiscalAddress()); - Assert.assertEquals(foundProperties.get(1), bob.getFiscalAddress()); + Assert.assertEquals(foundProperties.get(0), alice.getBirthDate()); + Assert.assertEquals(foundProperties.get(1), bob.getBirthDate()); foundProperties = personDAO.findFilteredProperties( filter, Integer.MAX_VALUE, 0, - Arrays.asList("name", "birthDate"), + Arrays.asList("id", "birthDate"), Order.desc("name.givenName")); Assert.assertEquals(foundProperties.size(), 2); Object[] bobsProperties = (Object[]) foundProperties.get(0); - Assert.assertEquals(bobsProperties[0], bob.getName()); + Assert.assertEquals(bobsProperties[0], bob.getId()); Assert.assertEquals(bobsProperties[1], bob.getBirthDate()); Object[] alicesProperties = (Object[]) foundProperties.get(1); - Assert.assertEquals(alicesProperties[0], alice.getName()); + Assert.assertEquals(alicesProperties[0], alice.getId()); Assert.assertEquals(alicesProperties[1], alice.getBirthDate()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 14:13:13
|
Revision: 4038 http://openutils.svn.sourceforge.net/openutils/?rev=4038&view=rev Author: gcatania Date: 2012-05-20 14:13:06 +0000 (Sun, 20 May 2012) Log Message: ----------- BSHD-2 fix property methods Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2012-05-20 13:12:26 UTC (rev 4037) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2012-05-20 14:13:06 UTC (rev 4038) @@ -175,7 +175,7 @@ * @param orders the orders to apply with respect to entity class properties * @return a list of distinct entity instances (never null) */ - List<Object[]> findFilteredProperties(T filter, int maxResults, int page, List<String> properties, Order... orders); + List<Object> findFilteredProperties(T filter, int maxResults, int page, List<String> properties, Order... orders); /** * Retrieve a set of properties from the entities returned by @@ -189,7 +189,7 @@ * @param orders the orders to apply with respect to entity class properties * @return a list of distinct entity instances (never null) */ - List<Object[]> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, List<String> properties, + List<Object> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, List<String> properties, Order... orders); /** @@ -462,7 +462,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List<Object[]> findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, + List<Object> findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties); } 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-05-20 13:12:26 UTC (rev 4037) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-20 14:13:06 UTC (rev 4038) @@ -436,7 +436,7 @@ /** * {@inheritDoc} */ - public List<Object[]> findFilteredProperties(T filter, int maxResults, int page, List<String> properties, + public List<Object> findFilteredProperties(T filter, int maxResults, int page, List<String> properties, Order... orders) { return getThis().findFilteredProperties(new ExampleTree(filter), maxResults, page, properties, orders); @@ -445,7 +445,7 @@ /** * {@inheritDoc} */ - public List<Object[]> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, + public List<Object> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, List<String> properties, Order... orders) { return getHibernateTemplate().execute( @@ -508,7 +508,7 @@ * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List<Object[]> findFilteredProperties(T filter, Order[] orders, + public List<Object> findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties) { @@ -778,7 +778,7 @@ * @author gcatania */ @SuppressWarnings("deprecation") - private final class LegacySupportPropertiesCallback extends LegacySupportCallback<Object[]> + private final class LegacySupportPropertiesCallback extends LegacySupportCallback<Object> { private final List<String> properties; @@ -871,7 +871,7 @@ } -class ExampleTreePropertiesCallback extends ExampleTreeCallback<Object[]> +class ExampleTreePropertiesCallback extends ExampleTreeCallback<Object> { private final List<String> properties; 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-05-20 13:12:26 UTC (rev 4037) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-05-20 14:13:06 UTC (rev 4038) @@ -402,7 +402,7 @@ st1.setHeight(20d); st1.setWidth(10d); Sticker st2 = new Sticker(); - st2.setName("Object in the mirror are losing"); + st2.setName("Objects in the mirror are losing"); st2.setHeight(5d); st2.setWidth(10d); Sticker st3 = new Sticker(); @@ -423,8 +423,10 @@ @Test public void testFindFilteredProperties() { - personDAO.save(alice()); - personDAO.save(bob()); + Person alice = alice(); + Person bob = bob(); + personDAO.save(alice); + personDAO.save(bob); personDAO.save(chuck()); Address addressFilter = new Address(); @@ -432,21 +434,32 @@ Person filter = new Person(); filter.setCurrentAddress(addressFilter); - List<Object[]> foundProperties = personDAO.findFilteredProperties( + List<Object> foundProperties = personDAO.findFilteredProperties( filter, Integer.MAX_VALUE, 0, + Collections.singletonList("fiscalAddress")); + + Assert.assertEquals(foundProperties.size(), 2); + + Assert.assertEquals(foundProperties.get(0), alice.getFiscalAddress()); + Assert.assertEquals(foundProperties.get(1), bob.getFiscalAddress()); + + foundProperties = personDAO.findFilteredProperties( + filter, + Integer.MAX_VALUE, + 0, Arrays.asList("name", "birthDate"), Order.desc("name.givenName")); Assert.assertEquals(foundProperties.size(), 2); - Object[] bobsProperties = foundProperties.get(0); - Assert.assertEquals(bobsProperties[0], bob().getName()); - Assert.assertEquals(bobsProperties[1], bob().getBirthDate()); - Object[] alicesProperties = foundProperties.get(1); - Assert.assertEquals(alicesProperties[0], alice().getName()); - Assert.assertEquals(alicesProperties[1], alice().getBirthDate()); + Object[] bobsProperties = (Object[]) foundProperties.get(0); + Assert.assertEquals(bobsProperties[0], bob.getName()); + Assert.assertEquals(bobsProperties[1], bob.getBirthDate()); + Object[] alicesProperties = (Object[]) foundProperties.get(1); + Assert.assertEquals(alicesProperties[0], alice.getName()); + Assert.assertEquals(alicesProperties[1], alice.getBirthDate()); } // @Test This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gca...@us...> - 2012-05-20 13:12:33
|
Revision: 4037 http://openutils.svn.sourceforge.net/openutils/?rev=4037&view=rev Author: gcatania Date: 2012-05-20 13:12:26 +0000 (Sun, 20 May 2012) Log Message: ----------- BSHD-2 code cleanup, added find properties support Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadata.java trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2012-05-15 19:48:16 UTC (rev 4036) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2012-05-20 13:12:26 UTC (rev 4037) @@ -164,13 +164,43 @@ List<T> findFiltered(ExampleTree exampleTree, int maxResults, int page, Order... orders); /** + * Retrieve a set of properties from the entities returned by + * {@link #findFiltered(Object, Order[], Map, int, int, List)} + * @param filter an instance of this DAO's entity class to be used as filter + * @param maxResults the maximum number of results to be fetched + * @param page the zero-based page number to use when displaying paginated results (the first entity returned is the + * one at position <code>maxResults * page</code> in the complete list of results), or <code>0</code> for no + * pagination + * @param properties the names of the properties to return + * @param orders the orders to apply with respect to entity class properties + * @return a list of distinct entity instances (never null) + */ + List<Object[]> findFilteredProperties(T filter, int maxResults, int page, List<String> properties, Order... orders); + + /** + * Retrieve a set of properties from the entities returned by + * {@link #findFiltered(Object, Order[], Map, int, int, List)} + * @param exampleTree the example tree criterion to match + * @param maxResults the maximum number of results to be fetched + * @param page the zero-based page number to use when displaying paginated results (the first entity returned is the + * one at position <code>maxResults * page</code> in the complete list of results), or <code>0</code> for no + * pagination + * @param properties the names of the properties to return + * @param orders the orders to apply with respect to entity class properties + * @return a list of distinct entity instances (never null) + */ + List<Object[]> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, List<String> properties, + Order... orders); + + /** * Retrieve the entities handled by this DAO whose property values match, via <code>equals()</code> or via a * specified <code>FilterMetadata</code> object, <code>filter</code>'s non-null property values. * @param filter an instance of this DAO's entity class to be used as filter * @param metadata a map that matches names of entity class properties to <code>FilterMetadata</code> modifiers, * that will be used for comparing values of the corresponding property * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata); @@ -186,7 +216,8 @@ * one at position <code>maxResults * page</code> in the complete list of results), or <code>0</code> for no * pagination * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page); @@ -204,7 +235,8 @@ * pagination * @param orders the orders to apply with respect to entity class properties * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, @@ -224,33 +256,14 @@ * @param criteria a list of additional Hibernate criteria * @param orders the orders to apply with respect to entity class properties * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, Order... orders); /** - * Retrieve a set of properties from the entities returned by - * {@link #findFiltered(Object, Order[], Map, int, int, List)} - * @param filter an instance of this DAO's entity class to be used as filter - * @param metadata a map that matches names of entity class properties to <code>FilterMetadata</code> modifiers, - * that will be used for comparing values of the corresponding property - * @param maxResults the maximum number of results to be fetched - * @param page the zero-based page number to use when displaying paginated results (the first entity returned is the - * one at position <code>maxResults * page</code> in the complete list of results), or <code>0</code> for no - * pagination - * @param criteria a list of additional Hibernate criteria - * @param properties the names of the properties to return - * @param orders the orders to apply with respect to entity class properties - * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated - */ - @Deprecated - List< ? > findFilteredProperties(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, - int page, List< ? extends Criterion> criteria, List<String> properties, Order... orders); - - /** * Retrieve the first entity instance that matches the input <code>filter</code>, if existing. * @param filter an instance of this DAO's entity class to be used as filter * @return the first matching instance of the entity class managed by this DAO, or <code>null</code> if none found @@ -403,7 +416,8 @@ * one at position <code>maxResults * page</code> in the complete list of results), or <code>0</code> for no * pagination * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated List<T> findFiltered(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, @@ -423,7 +437,8 @@ * pagination * @param criteria a list of additional Hibernate criteria * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated List<T> findFiltered(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, @@ -443,10 +458,11 @@ * @param criteria a list of additional Hibernate criteria * @param properties the names of the properties to return * @return a list of distinct entity instances (never null) - * @deprecated use of {@link FilterMetadata} has been deprecated + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ @Deprecated - List< ? > findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, + List<Object[]> findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties); } 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-05-15 19:48:16 UTC (rev 4036) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2012-05-20 13:12:26 UTC (rev 4037) @@ -31,7 +31,6 @@ import java.io.Serializable; import java.sql.SQLException; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -43,7 +42,6 @@ import org.hibernate.Criteria; import org.hibernate.Hibernate; import org.hibernate.HibernateException; -import org.hibernate.ObjectNotFoundException; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.CriteriaSpecification; @@ -128,26 +126,8 @@ /** * {@inheritDoc} */ - public List<T> find(List< ? extends Criterion> criteria, Order... orders) + public List<T> find(final List< ? extends Criterion> criteria, final Order... orders) { - final List< ? extends Criterion> actualCriteria; - if (criteria != null) - { - actualCriteria = criteria; - } - else - { - actualCriteria = Collections.<Criterion> emptyList(); - } - final List<Order> actualOrders; - if (orders != null) - { - actualOrders = Arrays.asList(orders); - } - else - { - actualOrders = Collections.<Order> emptyList(); - } return getHibernateTemplate().execute(new HibernateCallback<List<T>>() { @@ -155,13 +135,19 @@ public List<T> doInHibernate(final Session ses) throws HibernateException { Criteria crit = ses.createCriteria(getReferenceClass()); - for (Criterion c : actualCriteria) + if (criteria != null) { - crit.add(c); + for (Criterion c : criteria) + { + crit.add(c); + } } - for (Order o : actualOrders) + if (orders != null) { - crit.addOrder(o); + for (Order o : orders) + { + crit.addOrder(o); + } } return crit.list(); } @@ -251,7 +237,8 @@ } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata) @@ -266,7 +253,8 @@ } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page) @@ -337,19 +325,12 @@ */ public T loadIfAvailable(K key) { - try + T result = getHibernateTemplate().get(getReferenceClass(), key); + if (result != null) { - T result = getHibernateTemplate().get(getReferenceClass(), key); - if (result != null) - { - Hibernate.initialize(result); - return result; - } + Hibernate.initialize(result); + return result; } - catch (ObjectNotFoundException e) - { - // thrown by HibernateTemplate#get() if the object does not exist - } return null; } @@ -449,12 +430,32 @@ */ public List<T> findFiltered(ExampleTree exampleTree, int maxResults, int page, Order... orders) { - return getHibernateTemplate().execute(new ExampleTreeCallback(exampleTree, orders, maxResults, page)); + return getHibernateTemplate().execute(new ExampleTreeCallback<T>(exampleTree, maxResults, page, orders)); } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * {@inheritDoc} */ + public List<Object[]> findFilteredProperties(T filter, int maxResults, int page, List<String> properties, + Order... orders) + { + return getThis().findFilteredProperties(new ExampleTree(filter), maxResults, page, properties, orders); + } + + /** + * {@inheritDoc} + */ + public List<Object[]> findFilteredProperties(ExampleTree exampleTree, int maxResults, int page, + List<String> properties, Order... orders) + { + return getHibernateTemplate().execute( + new ExampleTreePropertiesCallback(exampleTree, maxResults, page, properties, orders)); + } + + /** + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} + */ @Deprecated public List<T> findFiltered(T filter, Order[] customOrder, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page) @@ -469,7 +470,8 @@ } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, @@ -479,47 +481,20 @@ } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated public List<T> findFiltered(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, Order... orders) { - HibernateCallback<List<T>> callback; - if (MapUtils.isNotEmpty(metadata)) - { - // backwards compatibility - callback = new HibernateCallbackForExecution( - filter, - page, - maxResults, - metadata, - orders, - criteria, - Collections.<String> emptyList()); - } - else - { - ExampleTree exampleTree = new ExampleTree(filter); - appendToRoot(exampleTree, criteria); - callback = new ExampleTreeCallback(exampleTree, orders, maxResults, page); - } - return getHibernateTemplate().execute(callback); - } - - /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} - */ - @Deprecated - public List< ? > findFilteredProperties(T filter, Map<String, ? extends FilterMetadata> metadata, int maxResults, - int page, List< ? extends Criterion> criteria, List<String> properties, Order... orders) - { return getHibernateTemplate().execute( - new HibernateCallbackForExecution(filter, page, maxResults, metadata, orders, criteria, properties)); + new LegacySupportCallback<T>(filter, maxResults, page, metadata, criteria, orders)); } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated public List<T> findFiltered(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, @@ -529,14 +504,16 @@ } /** - * @deprecated use of {@link FilterMetadata} has been deprecated {@inheritDoc} + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} {@inheritDoc} */ @Deprecated - public List< ? > findFilteredProperties(T filter, Order[] orders, Map<String, ? extends FilterMetadata> metadata, - int maxResults, int page, List< ? extends Criterion> criteria, List<String> properties) + public List<Object[]> findFilteredProperties(T filter, Order[] orders, + Map<String, ? extends FilterMetadata> metadata, int maxResults, int page, List< ? extends Criterion> criteria, + List<String> properties) { return getHibernateTemplate().execute( - new HibernateCallbackForExecution(filter, page, maxResults, metadata, orders, criteria, properties)); + new LegacySupportPropertiesCallback(filter, maxResults, page, metadata, criteria, properties, orders)); } /** @@ -578,12 +555,13 @@ * @param maxResults max number of results * @return Query */ - protected List< ? > findByNamedQuery(final String name, final Serializable[] params, final Integer maxResults) + protected List<Object> findByNamedQuery(final String name, final Serializable[] params, final Integer maxResults) { - return getHibernateTemplate().execute(new HibernateCallback<List< ? >>() + return getHibernateTemplate().execute(new HibernateCallback<List<Object>>() { - public List< ? > doInHibernate(final Session ses) throws HibernateException + @SuppressWarnings("unchecked") + public List<Object> doInHibernate(final Session ses) throws HibernateException { Query q = ses.getNamedQuery(name); if (maxResults != null) @@ -609,12 +587,13 @@ * @param maxResults max number of results * @return Query */ - protected List< ? > findByNamedQuery(final String name, final Map<String, ? > params, final Integer maxResults) + protected List<Object> findByNamedQuery(final String name, final Map<String, ? > params, final Integer maxResults) { - return getHibernateTemplate().execute(new HibernateCallback<List< ? >>() + return getHibernateTemplate().execute(new HibernateCallback<List<Object>>() { - public List< ? > doInHibernate(final Session ses) throws HibernateException + @SuppressWarnings("unchecked") + public List<Object> doInHibernate(final Session ses) throws HibernateException { Query q = ses.getNamedQuery(name); if (maxResults != null) @@ -643,7 +622,7 @@ * @deprecated use the better named <code>findByNamedQuery</code> method */ @Deprecated - protected List< ? > getNamedQuery(String name, Serializable[] params, int maxResults) + protected List<Object> getNamedQuery(String name, Serializable[] params, int maxResults) { return findByNamedQuery(name, params, maxResults > 0 ? maxResults : Integer.MAX_VALUE); } @@ -657,7 +636,7 @@ * @deprecated use the better named <code>findByNamedQuery</code> method */ @Deprecated - protected List< ? > getNamedQuery(String name, Map<String, ? > params, int maxResults) + protected List<Object> getNamedQuery(String name, Map<String, ? > params, int maxResults) { return findByNamedQuery(name, params, maxResults > 0 ? maxResults : Integer.MAX_VALUE); } @@ -682,7 +661,10 @@ * Returns the default set of FilterMetadata that will be applied to any query. The default implementation doesn't * set any default filter, subclasses may override this. * @return map of property name - filter metadata + * @deprecated {@link FilterMetadata} has been deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} */ + @Deprecated protected Map<String, ? extends FilterMetadata> getDefaultFilterMetadata() { return Collections.emptyMap(); @@ -748,121 +730,80 @@ /** * @author gcatania */ - private final class ExampleTreeCallback implements HibernateCallback<List<T>> + @SuppressWarnings("deprecation") + private class LegacySupportCallback<R> extends ExampleTreeCallback<R> { - private final Order[] orders; + private final T rootEntity; - private final int page; + private final Map<String, ? extends FilterMetadata> filterMetadata; - private final int maxResults; + private final List< ? extends Criterion> additionalCriteria; - private final ExampleTree exampleTree; - - private ExampleTreeCallback(ExampleTree exampleTree, Order[] orders, int maxResults, int page) + private LegacySupportCallback( + T rootEntity, + int maxResults, + int page, + Map<String, ? extends FilterMetadata> metadata, + List< ? extends Criterion> additionalCriteria, + Order... orders) { - this.exampleTree = exampleTree; - this.orders = orders; - this.page = page; - this.maxResults = maxResults; + super(new ExampleTree(rootEntity), maxResults, page, orders); + this.rootEntity = rootEntity; + this.filterMetadata = metadata; + this.additionalCriteria = additionalCriteria; } - @SuppressWarnings("unchecked") - public List<T> doInHibernate(Session session) throws HibernateException, SQLException + @Override + protected Criteria createCriteria(Session session) { - Criteria crit = exampleTree.create(session); - - // backwards compatibility - Map<String, ? extends FilterMetadata> filterMetadata = getDefaultFilterMetadata(); + Criteria crit = super.createCriteria(session); if (MapUtils.isNotEmpty(filterMetadata)) { - new FilterMetadataSupport(exampleTree.getRootEntity(), filterMetadata).appendTo(crit, session); + new FilterMetadataSupport(rootEntity, filterMetadata).appendTo(crit, session); } - - crit.setMaxResults(maxResults); - crit.setFirstResult(maxResults * page); - if (orders != null) + if (additionalCriteria != null) { - for (Order o : orders) + for (Criterion c : additionalCriteria) { - crit.addOrder(o); + crit.add(c); } } - return crit.list(); + return crit; } + } /** - * @deprecated callback implementation that uses EnhancedExample, deprecated in favor of ExampleTreeCallback - * @author carone - * @version $Id$ + * @author gcatania */ - @Deprecated - private final class HibernateCallbackForExecution implements HibernateCallback<List<T>> + @SuppressWarnings("deprecation") + private final class LegacySupportPropertiesCallback extends LegacySupportCallback<Object[]> { - private T filter; + private final List<String> properties; - private int page; - - private int maxResults; - - private Map<String, ? extends FilterMetadata> metadata; - - private List<String> properties; - - private Order[] orderProperties; - - private List< ? extends Criterion> additionalCriteria; - - private HibernateCallbackForExecution( - T filter, + private LegacySupportPropertiesCallback( + T rootEntity, + int maxResults, int page, - int maxResults, Map<String, ? extends FilterMetadata> metadata, - Order[] orderProperties, List< ? extends Criterion> additionalCriteria, - List<String> properties) + List<String> properties, + Order... orders) { - this.filter = filter; - this.page = page; - this.maxResults = maxResults; - this.metadata = metadata; - this.orderProperties = orderProperties; - this.additionalCriteria = additionalCriteria; + super(rootEntity, maxResults, page, metadata, additionalCriteria, orders); this.properties = properties; + } - @SuppressWarnings("unchecked") - public List<T> doInHibernate(Session ses) throws HibernateException + @Override + protected Criteria createCriteria(Session session) { - // Criteria crit = ses.createCriteria(filter.getClass()); - Criteria crit = new FilterMetadataSupport(filter, metadata).create(ses); - crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); - crit.setMaxResults(maxResults); - crit.setFirstResult(maxResults * page); - - if (orderProperties != null) - { - for (Order order : orderProperties) - { - if (order != null) - { - crit.addOrder(order); - } - } - } - if (!CollectionUtils.isEmpty(additionalCriteria)) - { - for (Criterion criterion : additionalCriteria) - { - crit.add(criterion); - } - } + Criteria crit = super.createCriteria(session); if (!CollectionUtils.isEmpty(properties)) { ProjectionList projectionList = Projections.projectionList(); - for (String property : properties) { projectionList.add(Property.forName(property)); @@ -870,8 +811,93 @@ crit.setProjection(projectionList); } - return crit.list(); + return crit; } } +} -} \ No newline at end of file + +/** + * @author gcatania + * @param R the result class + */ +class ExampleTreeCallback<R> implements HibernateCallback<List<R>> +{ + + private final Order[] orders; + + private final int maxResults; + + private final int page; + + private final ExampleTree exampleTree; + + protected ExampleTreeCallback(ExampleTree exampleTree, 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()} + * @param session the hibernate session + * @return the hibernate criteria + */ + protected Criteria createCriteria(Session session) + { + Criteria crit = exampleTree.create(session); + + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + crit.setMaxResults(maxResults); + crit.setFirstResult(maxResults * page); + if (orders != null) + { + for (Order o : orders) + { + crit.addOrder(o); + } + } + + return crit; + } + + @SuppressWarnings("unchecked") + public List<R> doInHibernate(Session session) throws HibernateException, SQLException + { + return createCriteria(session).list(); + } +} + + +class ExampleTreePropertiesCallback extends ExampleTreeCallback<Object[]> +{ + + private final List<String> properties; + + protected ExampleTreePropertiesCallback(ExampleTree exampleTree, int maxResults, int page, + + List<String> properties, Order... orders) + { + super(exampleTree, maxResults, page, orders); + this.properties = properties; + } + + @Override + protected Criteria createCriteria(Session session) + { + Criteria crit = super.createCriteria(session); + if (!CollectionUtils.isEmpty(properties)) + { + ProjectionList projectionList = Projections.projectionList(); + for (String property : properties) + { + projectionList.add(Property.forName(property)); + } + + crit.setProjection(projectionList); + } + return crit; + } +} 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-05-15 19:48:16 UTC (rev 4036) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/ExampleTree.java 2012-05-20 13:12:26 UTC (rev 4037) @@ -74,9 +74,9 @@ private boolean isIgnoreCaseEnabled; - private Map<String, Set<String>> excludedProperties = new HashMap<String, Set<String>>(); + private final Map<String, Set<String>> excludedProperties = new HashMap<String, Set<String>>(); - private Map<String, List<Criterion>> additionalConditions = new HashMap<String, List<Criterion>>(); + private final Map<String, List<Criterion>> additionalConditions = new HashMap<String, List<Criterion>>(); /** * builds an instance of {@code ExampleTree} associated with the input entity @@ -246,14 +246,6 @@ return this; } - /** - * @return the rootEntity - */ - public Object getRootEntity() - { - return rootEntity; - } - private class ExampleTreeWalker implements Serializable { @@ -261,7 +253,7 @@ private final SessionFactory sessionFactory; - private EntityMode entityMode; + private final EntityMode entityMode; public ExampleTreeWalker(Session session) { Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadata.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadata.java 2012-05-15 19:48:16 UTC (rev 4036) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadata.java 2012-05-20 13:12:26 UTC (rev 4037) @@ -25,9 +25,8 @@ package it.openutils.hibernate.example; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.hibernate.Criteria; +import org.hibernate.criterion.Criterion; import org.hibernate.criterion.MatchMode; import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; @@ -36,9 +35,12 @@ /** * FilterMetadata can be used to alter how properties are handled. + * @deprecated in favor of {@link ExampleTree#add(String, Criterion)} and + * {@link ExampleTree#overridePropertyFilter(String, String, Criterion)} * @author Fabrizio Giustina * @version $Id: $ */ +@Deprecated public interface FilterMetadata { @@ -48,7 +50,7 @@ FilterMetadata LIKE = new FilterMetadata() { - private Logger log = LoggerFactory.getLogger(FilterMetadata.class); + private final Logger log = LoggerFactory.getLogger(FilterMetadata.class); /** * {@inheritDoc} @@ -70,7 +72,7 @@ FilterMetadata EQUAL = new FilterMetadata() { - private Log log = LogFactory.getLog(FilterMetadata.class); + private final Logger log = LoggerFactory.getLogger(FilterMetadata.class); /** * {@inheritDoc} 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-05-15 19:48:16 UTC (rev 4036) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/FilterMetadataSupport.java 2012-05-20 13:12:26 UTC (rev 4037) @@ -45,15 +45,16 @@ /** - * legacy support for filter metadata. + * legacy support for {@link FilterMetadata}. * @author gcatania */ +@SuppressWarnings("deprecation") public class FilterMetadataSupport { private final Object entity; - private Map<String, ? extends FilterMetadata> filterMetadata; + private final Map<String, ? extends FilterMetadata> filterMetadata; /** * builds an instance of {@code ExampleTree} associated with the input entity @@ -97,7 +98,7 @@ private final SessionFactory sessionFactory; - private EntityMode entityMode; + private final EntityMode entityMode; public ExampleTreeWalker(Session session) { 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-05-15 19:48:16 UTC (rev 4036) +++ trunk/openutils-bshd5/src/test/java/it/openutils/hibernate/test/HibernateDAOPersistenceTest.java 2012-05-20 13:12:26 UTC (rev 4037) @@ -48,6 +48,7 @@ import java.util.List; import org.hibernate.criterion.Example; +import org.hibernate.criterion.Order; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; @@ -419,6 +420,35 @@ Assert.assertEquals(found.size(), 2); } + @Test + public void testFindFilteredProperties() + { + personDAO.save(alice()); + personDAO.save(bob()); + personDAO.save(chuck()); + + Address addressFilter = new Address(); + addressFilter.setCity("Smalltown"); + Person filter = new Person(); + filter.setCurrentAddress(addressFilter); + + List<Object[]> foundProperties = personDAO.findFilteredProperties( + filter, + Integer.MAX_VALUE, + 0, + Arrays.asList("name", "birthDate"), + Order.desc("name.givenName")); + + Assert.assertEquals(foundProperties.size(), 2); + + Object[] bobsProperties = foundProperties.get(0); + Assert.assertEquals(bobsProperties[0], bob().getName()); + Assert.assertEquals(bobsProperties[1], bob().getBirthDate()); + Object[] alicesProperties = foundProperties.get(1); + Assert.assertEquals(alicesProperties[0], alice().getName()); + Assert.assertEquals(alicesProperties[1], alice().getBirthDate()); + + } // @Test // public void testExampleAssociations() // { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 4036 http://openutils.svn.sourceforge.net/openutils/?rev=4036&view=rev Author: fgiust Date: 2012-05-15 19:48:16 +0000 (Tue, 15 May 2012) Log Message: ----------- hasChildren -> hasContent Modified Paths: -------------- magnoliamodules/branches/magnolia44/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/dev/ModuleDevelopmentUtilsPage.java Modified: magnoliamodules/branches/magnolia44/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/dev/ModuleDevelopmentUtilsPage.java =================================================================== --- magnoliamodules/branches/magnolia44/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/dev/ModuleDevelopmentUtilsPage.java 2012-05-06 17:50:05 UTC (rev 4035) +++ magnoliamodules/branches/magnolia44/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/dev/ModuleDevelopmentUtilsPage.java 2012-05-15 19:48:16 UTC (rev 4036) @@ -515,7 +515,7 @@ Content menu = hm.getContent("/modules/adminInterface/config/menu/tools", true, ItemType.CONTENT); - if (!menu.hasChildren(pagename)) + if (!menu.hasContent(pagename)) { Content page = menu.createContent(pagename, ItemType.CONTENTNODE); page.setNodeData("icon", "/.resources/tasks/ico16-save.png"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:50:11
|
Revision: 4035 http://openutils.svn.sourceforge.net/openutils/?rev=4035&view=rev Author: fgiust Date: 2012-05-06 17:50:05 +0000 (Sun, 06 May 2012) Log Message: ----------- update version Modified Paths: -------------- magnoliamodules/trunk/magnolia-test-webapp/pom.xml Modified: magnoliamodules/trunk/magnolia-test-webapp/pom.xml =================================================================== --- magnoliamodules/trunk/magnolia-test-webapp/pom.xml 2012-05-06 17:48:10 UTC (rev 4034) +++ magnoliamodules/trunk/magnolia-test-webapp/pom.xml 2012-05-06 17:50:05 UTC (rev 4035) @@ -151,7 +151,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnlmedia</artifactId> - <version>5.0.0-SNAPSHOT</version> + <version>5.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:48:16
|
Revision: 4034 http://openutils.svn.sourceforge.net/openutils/?rev=4034&view=rev Author: fgiust Date: 2012-05-06 17:48:10 +0000 (Sun, 06 May 2012) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlmedia/pom.xml Modified: magnoliamodules/trunk/openutils-mgnlmedia/pom.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/pom.xml 2012-05-06 17:48:03 UTC (rev 4033) +++ magnoliamodules/trunk/openutils-mgnlmedia/pom.xml 2012-05-06 17:48:10 UTC (rev 4034) @@ -10,7 +10,7 @@ <artifactId>openutils-mgnlmedia</artifactId> <name>SimpleMedia Module for Magnolia CMS</name> <description>SimpleMedia Module for Magnolia CMS: a module for Magnolia CMS for easier management of multimedia assets.</description> - <version>5.0.0</version> + <version>5.0.1-SNAPSHOT</version> <inceptionYear>2008</inceptionYear> <licenses> <license> @@ -24,9 +24,9 @@ <url>http://jira.openmindlab.com/browse/MEDIA</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-5.0.0</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-5.0.0</developerConnection> - <url>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-5.0.0</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlmedia</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlmedia</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlmedia</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:48:09
|
Revision: 4033 http://openutils.svn.sourceforge.net/openutils/?rev=4033&view=rev Author: fgiust Date: 2012-05-06 17:48:03 +0000 (Sun, 06 May 2012) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlmedia-5.0.0 Added Paths: ----------- tags/openutils-mgnlmedia-5.0.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:47:50
|
Revision: 4032 http://openutils.svn.sourceforge.net/openutils/?rev=4032&view=rev Author: fgiust Date: 2012-05-06 17:47:43 +0000 (Sun, 06 May 2012) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlmedia-5.0.0 Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlmedia/pom.xml Modified: magnoliamodules/trunk/openutils-mgnlmedia/pom.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlmedia/pom.xml 2012-05-06 17:44:06 UTC (rev 4031) +++ magnoliamodules/trunk/openutils-mgnlmedia/pom.xml 2012-05-06 17:47:43 UTC (rev 4032) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -11,7 +10,7 @@ <artifactId>openutils-mgnlmedia</artifactId> <name>SimpleMedia Module for Magnolia CMS</name> <description>SimpleMedia Module for Magnolia CMS: a module for Magnolia CMS for easier management of multimedia assets.</description> - <version>5.0.0-SNAPSHOT</version> + <version>5.0.0</version> <inceptionYear>2008</inceptionYear> <licenses> <license> @@ -25,9 +24,9 @@ <url>http://jira.openmindlab.com/browse/MEDIA</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlmedia</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlmedia</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlmedia</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-5.0.0</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-5.0.0</developerConnection> + <url>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-5.0.0</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:44:12
|
Revision: 4031 http://openutils.svn.sourceforge.net/openutils/?rev=4031&view=rev Author: fgiust Date: 2012-05-06 17:44:06 +0000 (Sun, 06 May 2012) Log Message: ----------- update version Modified Paths: -------------- magnoliamodules/trunk/magnolia-test-webapp/pom.xml Modified: magnoliamodules/trunk/magnolia-test-webapp/pom.xml =================================================================== --- magnoliamodules/trunk/magnolia-test-webapp/pom.xml 2012-05-06 17:43:32 UTC (rev 4030) +++ magnoliamodules/trunk/magnolia-test-webapp/pom.xml 2012-05-06 17:44:06 UTC (rev 4031) @@ -146,7 +146,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnlgroovy</artifactId> - <version>5.0.0-SNAPSHOT</version> + <version>5.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:43:38
|
Revision: 4030 http://openutils.svn.sourceforge.net/openutils/?rev=4030&view=rev Author: fgiust Date: 2012-05-06 17:43:32 +0000 (Sun, 06 May 2012) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml Modified: magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml 2012-05-06 17:43:25 UTC (rev 4029) +++ magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml 2012-05-06 17:43:32 UTC (rev 4030) @@ -10,7 +10,7 @@ <artifactId>openutils-mgnlgroovy</artifactId> <name>Groovy Shell for Magnolia CMS</name> <description>Groovy Shell for Magnolia CMS is a module for running Groovy Scripts from the Magnolia admin interface. </description> - <version>5.0.0</version> + <version>5.0.1-SNAPSHOT</version> <inceptionYear>2008</inceptionYear> <licenses> <license> @@ -24,9 +24,9 @@ <url>http://jira.openmindlab.com/browse/GROOVY</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlgroovy-5.0.0</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlgroovy-5.0.0</developerConnection> - <url>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlgroovy-5.0.0</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlgroovy</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlgroovy</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlgroovy</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:43:31
|
Revision: 4029 http://openutils.svn.sourceforge.net/openutils/?rev=4029&view=rev Author: fgiust Date: 2012-05-06 17:43:25 +0000 (Sun, 06 May 2012) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlgroovy-5.0.0 Added Paths: ----------- tags/openutils-mgnlgroovy-5.0.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:43:12
|
Revision: 4028 http://openutils.svn.sourceforge.net/openutils/?rev=4028&view=rev Author: fgiust Date: 2012-05-06 17:43:06 +0000 (Sun, 06 May 2012) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlgroovy-5.0.0 Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml Modified: magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml 2012-05-06 17:42:36 UTC (rev 4027) +++ magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml 2012-05-06 17:43:06 UTC (rev 4028) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -11,7 +10,7 @@ <artifactId>openutils-mgnlgroovy</artifactId> <name>Groovy Shell for Magnolia CMS</name> <description>Groovy Shell for Magnolia CMS is a module for running Groovy Scripts from the Magnolia admin interface. </description> - <version>5.0.0-SNAPSHOT</version> + <version>5.0.0</version> <inceptionYear>2008</inceptionYear> <licenses> <license> @@ -25,9 +24,9 @@ <url>http://jira.openmindlab.com/browse/GROOVY</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlgroovy</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/magnoliamodules/trunk/openutils-mgnlgroovy</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlgroovy</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlgroovy-5.0.0</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlgroovy-5.0.0</developerConnection> + <url>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlgroovy-5.0.0</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2012-05-06 17:42:42
|
Revision: 4027 http://openutils.svn.sourceforge.net/openutils/?rev=4027&view=rev Author: fgiust Date: 2012-05-06 17:42:36 +0000 (Sun, 06 May 2012) Log Message: ----------- fix version Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml Modified: magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml 2012-05-06 17:41:31 UTC (rev 4026) +++ magnoliamodules/trunk/openutils-mgnlgroovy/pom.xml 2012-05-06 17:42:36 UTC (rev 4027) @@ -91,7 +91,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnltasks</artifactId> - <version>5.0.</version> + <version>5.0.0</version> </dependency> <dependency> <groupId>javax.servlet</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |