Author: echatellier Date: 2013-04-08 16:44:16 +0200 (Mon, 08 Apr 2013) New Revision: 2707 Url: http://nuiton.org/projects/topia/repository/revisions/2707 Log: refs #2652: Update to hibernate 4.2.0.Final Removed: branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaFilterPagerUtil.java Modified: branches/topia-2.8.x-hibernate4/pom.xml branches/topia-2.8.x-hibernate4/topia-persistence/pom.xml branches/topia-2.8.x-hibernate4/topia-persistence/src/license/THIRD-PARTY.properties branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaUtil.java branches/topia-2.8.x-hibernate4/topia-persistence/src/test/java/org/nuiton/topia/framework/TopiaUtilTest.java branches/topia-2.8.x-hibernate4/topia-service-migration/src/license/THIRD-PARTY.properties branches/topia-2.8.x-hibernate4/topia-service-replication/src/license/THIRD-PARTY.properties branches/topia-2.8.x-hibernate4/topia-service-security/src/license/THIRD-PARTY.properties Modified: branches/topia-2.8.x-hibernate4/pom.xml =================================================================== --- branches/topia-2.8.x-hibernate4/pom.xml 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/pom.xml 2013-04-08 14:44:16 UTC (rev 2707) @@ -33,7 +33,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>mavenpom4redmineAndCentral</artifactId> - <version>3.4.7</version> + <version>3.4.9</version> </parent> <artifactId>topia</artifactId> @@ -59,14 +59,14 @@ <projectId>topia</projectId> <!-- libs version --> - <eugeneVersion>2.5.6.1</eugeneVersion> - <nuitonUtilsVersion>2.6.4</nuitonUtilsVersion> + <eugeneVersion>2.6.2</eugeneVersion> + <nuitonUtilsVersion>2.6.12</nuitonUtilsVersion> <processorPluginVersion>1.3</processorPluginVersion> <nuitonI18nVersion>2.5</nuitonI18nVersion> <xmlrpcVersion>3.1.2</xmlrpcVersion> - <hibernateVersion>4.2.0.CR2</hibernateVersion> - <sl4jVersion>1.6.6</sl4jVersion> - <h2Version>1.3.168</h2Version> + <hibernateVersion>4.2.0.Final</hibernateVersion> + <sl4jVersion>1.7.5</sl4jVersion> + <h2Version>1.3.171</h2Version> <hamcrestVersion>1.3</hamcrestVersion> <!-- i18n configuration --> @@ -142,12 +142,6 @@ <scope>runtime</scope> </dependency> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.6.1</version> - </dependency> - <!-- hibernate-core only include api, need implementation, binding with log4j will be used --> Modified: branches/topia-2.8.x-hibernate4/topia-persistence/pom.xml =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/pom.xml 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/pom.xml 2013-04-08 14:44:16 UTC (rev 2707) @@ -99,11 +99,6 @@ </dependency> <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - </dependency> - - <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </dependency> Modified: branches/topia-2.8.x-hibernate4/topia-persistence/src/license/THIRD-PARTY.properties =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/src/license/THIRD-PARTY.properties 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/src/license/THIRD-PARTY.properties 2013-04-08 14:44:16 UTC (rev 2707) @@ -1,10 +1,11 @@ # Generated by org.codehaus.mojo.license.AddThirdPartyMojo #------------------------------------------------------------------------------- # Already used licenses in project : +# - Apache License 2.0 # - BSD License -# - BSD style # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - Common Public License Version 1.0 +# - GNU Lesser General Public License, version 2.1 # - GNU Library or Lesser General Public License # - Indiana University Extreme! Lab Software License, vesion 1.1.1 # - Lesser General Public License (LGPL) v 3.0 @@ -13,19 +14,17 @@ # - MIT License # - MPL 1.1 # - Mozilla Public License Version 1.0 +# - New BSD License # - The Apache Software License, Version 2.0 # - The H2 License, Version 1.0 # - The SAX License # - The W3C License -# - The Werken Company License +# - http://jaxen.codehaus.org/license.html # - license.txt #------------------------------------------------------------------------------- # Please fill the missing licenses for dependencies : # # -#Sun Aug 19 16:33:57 CEST 2012 -antlr--antlr--2.7.6=BSD License +#Fri Mar 15 12:36:23 CET 2013 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 dom4j--dom4j--1.6.1=BSD License -javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 -jdom--jdom--1.0=The Apache Software License, Version 2.0 Modified: branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2013-04-08 14:44:16 UTC (rev 2707) @@ -262,30 +262,6 @@ void add(TopiaEntity e) throws TopiaException; /** - * Permet d'importer des données en XML. - * - * @param xml le flux XML - * @throws TopiaException si une erreur survient durant l'import - */ - void importXML(Reader xml) throws TopiaException; - - /** - * Permet d'exporter certaines données en XML. - * <p/> - * <b>Note:</b> Si le parametre <code>entityAndCondition</code> est vide, - * alors on duplique toutes les entités de la base. - * - * @param xml le flux XML dans lequel il faut ecrire - * @param entityAndCondition paramètre qui vont par deux, qui represente la - * classe de l'entity a exporter et la condition - * where que doit respecter l'objet pour etre - * exporter (entityClass, condition) - * @throws TopiaException si une erreur survient durant l'export - */ - void exportXML(Writer xml, Object... entityAndCondition) - throws TopiaException; - - /** * Permet de dupliquer de ce context vers un context d'une autre base des * données sans modification des entites. * <p/> Modified: branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2013-04-08 14:44:16 UTC (rev 2707) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2004 - 2010 CodeLutin + * Copyright (C) 2004 - 2013 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -32,8 +32,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.InputStream; -import java.io.Reader; -import java.io.Writer; import java.lang.reflect.Field; import java.sql.Connection; import java.sql.PreparedStatement; @@ -64,7 +62,6 @@ import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; -import org.hibernate.event.service.internal.EventListenerRegistryImpl; import org.hibernate.event.service.spi.EventListenerRegistry; import org.hibernate.event.spi.EventType; import org.hibernate.internal.SessionFactoryImpl; @@ -502,26 +499,23 @@ return hibernate; } - protected ServiceRegistry serviceRegistry; - public ServiceRegistry getServiceRegistry() throws TopiaNotFoundException { - if (serviceRegistry == null) { - ServiceRegistryBuilder serviceRegistryBuilder = new ServiceRegistryBuilder().applySettings( - getHibernateConfiguration().getProperties()); - - serviceRegistry = serviceRegistryBuilder.buildServiceRegistry(); - } - return serviceRegistry; - } @Override public SessionFactory getHibernateFactory() throws TopiaNotFoundException { if (hibernateFactory == null) { if (getParentContext() != null) { hibernateFactory = getParentContext().getHibernateFactory(); } else { - hibernateFactory = getHibernateConfiguration().buildSessionFactory(getServiceRegistry()); - EventListenerRegistry eventListenerRegistry = ((SessionFactoryImpl)hibernateFactory).getServiceRegistry() - .getService(EventListenerRegistry.class); + // init service registry + ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings( + getHibernateConfiguration().getProperties()).buildServiceRegistry(); + + hibernateFactory = getHibernateConfiguration().buildSessionFactory(serviceRegistry); + + // we can't reuse original serviceRegistry instance + // we must call getServiceRegistry on factory to get a working one + ServiceRegistry serviceRegistryInit = ((SessionFactoryImpl)hibernateFactory).getServiceRegistry(); + EventListenerRegistry eventListenerRegistry = serviceRegistryInit.getService(EventListenerRegistry.class); TopiaFiresSupport.TopiaHibernateEvent listener = new TopiaFiresSupport.TopiaHibernateEvent(this); eventListenerRegistry.appendListeners(EventType.PRE_INSERT, listener); @@ -1048,85 +1042,6 @@ } @Override - public void importXML(Reader xml) throws TopiaException { - checkClosed(_("topia.persistence.error.unsupported.operation.on.closed.context", - "importXML")); - - /*Document doc; - - SAXReader xmlReader = new SAXReader(); - try { - doc = xmlReader.read(xml); - if (log.isDebugEnabled()) { - log.debug("Lecture du document terminee"); - } - } catch (DocumentException de) { - throw new TopiaException( - _("topia.persistence.error.on.loding.xml.doc", - de.getMessage()), de); - } - - if (doc != null) { - Session sessionDom4j = getHibernate().getSession(EntityMode.DOM4J); - Element rootElement = doc.getRootElement(); - Iterator<?> it = rootElement.elementIterator(); - while (it.hasNext()) { - Element entity = (Element) it.next(); - try { - sessionDom4j.replicate(entity, ReplicationMode.EXCEPTION); - } catch (HibernateException he) { - log.warn(_("topia.persistence.error.replicate.entity", - entity, he.getMessage()), he); - } - } - // must commit data, otherwise : no effects... - sessionDom4j.flush(); - } else { - throw new TopiaException( - _("topia.persistence.error.empty.doc")); - }*/ - } - - @Override - public void exportXML(Writer xml, Object... entityAndcondition) - throws TopiaException { - checkClosed(_("topia.persistence.error.unsupported.operation.on.closed.context", - "exportXML")); - - /*String[] queries = buildQueries(entityAndcondition); - - // performs queries - try { - Session sessionDom4j = getHibernate().getSession(EntityMode.DOM4J); - - Document doc = DocumentFactory.getInstance().createDocument(); - Element rootElement = doc.addElement("topiaExport"); - DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); - String date = format.format(new Date(System.currentTimeMillis())); - rootElement.addAttribute("date", date); - - for (String query : queries) { - List<?> list = sessionDom4j.createQuery(query).list(); - for (Object o : list) { - rootElement.add((Element) o); - } - } - - XMLWriter result = new XMLWriter(xml, - OutputFormat.createPrettyPrint()); - result.write(doc); - result.close(); - - } catch (HibernateException eee) { - throw new TopiaException(_("topia.persistence.error.on.export", - eee.getMessage()), eee); - } catch (IOException eee) { - throw new TopiaException(_("topia.persistence.error.on.export", - eee.getMessage()), eee); - }*/ - } - - @Override public void replicate(TopiaContext dstCtxt, Object... entityAndCondition) throws TopiaException, IllegalArgumentException { checkClosed(_("topia.persistence.error.unsupported.operation.on.closed.context", Modified: branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaUtil.java =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaUtil.java 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaUtil.java 2013-04-08 14:44:16 UTC (rev 2707) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2004 - 2010 CodeLutin + * Copyright (C) 2004 - 2013 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -36,6 +36,7 @@ import org.apache.commons.logging.LogFactory; import org.hibernate.cfg.Configuration; import org.hibernate.dialect.Dialect; +import org.hibernate.internal.SessionFactoryImpl; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Table; import org.hibernate.service.ServiceRegistry; @@ -176,8 +177,9 @@ boolean exist = false; try { - Configuration configuration = - ((TopiaContextImplementor) tx).getHibernateConfiguration(); + TopiaContextImplementor txi = (TopiaContextImplementor) tx; + + Configuration configuration = txi.getHibernateConfiguration(); PersistentClass classMapping = configuration.getClassMapping(entityName); if (classMapping == null) { @@ -196,8 +198,9 @@ throw new IllegalArgumentException( "could not find entity with name " + entityName); } - - ServiceRegistry serviceRegistry = ((TopiaContextImpl) tx).getServiceRegistry(); + + SessionFactoryImpl sfi = (SessionFactoryImpl)txi.getHibernateFactory(); + ServiceRegistry serviceRegistry = sfi.getServiceRegistry(); ConnectionProvider connectionProvider = serviceRegistry.getService(ConnectionProvider.class); Dialect dialect = Dialect.getDialect(configuration.getProperties()); Deleted: branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaFilterPagerUtil.java =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaFilterPagerUtil.java 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaFilterPagerUtil.java 2013-04-08 14:44:16 UTC (rev 2707) @@ -1,365 +0,0 @@ -/* - * #%L - * ToPIA :: Persistence - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2012 CodeLutin - * %% - * This program 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 3 of the - * License, or (at your option) any later version. - * - * This program 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 General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package org.nuiton.topia.persistence; - -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.nuiton.topia.framework.TopiaQuery; -import org.nuiton.topia.persistence.pager.TopiaPagerBean; -import org.nuiton.util.PagerUtil; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * Extension of the simple {@link PagerUtil} from nuiton-utils to offer - * order and filter api. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.6.9 - * @deprecated since 2.6.14, use now {@link TopiaPagerBean}. - */ -@Deprecated -public class TopiaFilterPagerUtil extends PagerUtil { - - protected TopiaFilterPagerUtil() { - } - - /** - * @param query - * @param pager - * @return - * @deprecated since 2.6.12 TopiaQuery will be removed in version 3.0 of ToPIA - */ - @Deprecated - public static TopiaQuery addPagerToQuery(TopiaQuery query, - FilterPagerBean pager) { - PagerUtil.computeRecordIndexesAndPagesNumber(pager); - query.setLimit(pager.getRecordStartIndex(), - pager.getRecordEndIndex() - 1); - - if (StringUtils.isNotEmpty(pager.getSortColumn())) { - if (pager.isSortAscendant()) { - query.addOrder(pager.getSortColumn()); - } else { - query.addOrderDesc(pager.getSortColumn()); - } - } - return query; - } - - public static <E> List<E> getPageFromList(List<E> elements, - FilterPagerBean pager) { - - PagerUtil.computeRecordIndexesAndPagesNumber(pager); - List<E> subList = getPage(elements, pager.getPageIndex(), pager.getPageSize()); - List<E> result = new ArrayList<E>(subList); - - return result; - } - - public static FilterPagerBean newFilterPagerBean() { - return new FilterPagerBean(); - } - - public static class FilterPagerBean extends PagerBean { - - private static final long serialVersionUID = 1L; - - // sorting order - asc or desc - protected boolean sortAscendant; - - // get index row - i.e. user click to sort. - protected String sortColumn; - - protected FilterOperationGroup groupOp; - - private List<FilterRule> rules; - - public boolean canFilter() { - return groupOp != null && CollectionUtils.isNotEmpty(rules); - } - - public FilterOperationGroup getGroupOp() { - return groupOp; - } - - public void setGroupOp(FilterOperationGroup groupOp) { - this.groupOp = groupOp; - } - - public List<FilterRule> getRules() { - return rules; - } - - public void setRules(List<FilterRule> rules) { - this.rules = rules; - } - - public boolean isSortAscendant() { - return sortAscendant; - } - - public void setSortAscendant(boolean sortAscendant) { - this.sortAscendant = sortAscendant; - } - - public String getSortColumn() { - return sortColumn; - } - - public void setSortColumn(String sortColumn) { - this.sortColumn = sortColumn; - } - } - - public static class FilterRule implements Serializable { - - private static final long serialVersionUID = 1L; - - protected final FilterOperation op; - - protected final String field; - - protected final String data; - - public FilterRule(FilterOperation op, - String field, - String data) { - this.op = op; - this.field = field; - this.data = data; - } - - public FilterOperation getOp() { - return op; - } - - public String getField() { - return field; - } - - public String getData() { - return data; - } - } - - public enum FilterOperationGroup { - OR, AND - } - - public enum FilterOperation { - /** Equals operator. */ - eq { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " = :" + paramName; - filterParams.put(paramName, data); - return ruleFilter; - } - }, - /** Not equals operator. */ - ne { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " != :" + paramName; - filterParams.put(paramName, data); - return ruleFilter; - } - }, - /** Contains operator. */ - cn { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " like :" + paramName; - filterParams.put(paramName, "%" + data + "%"); - return ruleFilter; - } - }, - /** Not contains operator. */ - nc { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " not like :" + paramName; - filterParams.put(paramName, "%" + data + "%"); - return ruleFilter; - } - }, - /** Begins with operator. */ - bw { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " like :" + paramName; - filterParams.put(paramName, data + "%"); - return ruleFilter; - } - }, - /** Not between with operator. */ - bn { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " not like :" + paramName; - filterParams.put(paramName, data + "%"); - return ruleFilter; - } - }, - /** Ends with operator. */ - ew { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " like :" + paramName; - filterParams.put(paramName, "%" + data); - return ruleFilter; - } - }, - /** Not End with operator. */ - en { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " not like :" + paramName; - filterParams.put(paramName, "%" + data); - return ruleFilter; - } - }, - /** Lesser than operator. */ - lt { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " < :" + paramName; - filterParams.put(paramName, data); - return ruleFilter; - } - }, - /** Lesser or equals operator. */ - le { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " <= :" + paramName; - filterParams.put(paramName, data); - return ruleFilter; - } - }, - /** Greater than operator. */ - gt { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " > :" + paramName; - filterParams.put(paramName, data); - return ruleFilter; - } - }, - /** Greater or equals operator. */ - ge { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " >= :" + paramName; - filterParams.put(paramName, data); - return ruleFilter; - } - }, - /** Is null operator. */ - nu { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " is null"; - return ruleFilter; - } - }, - /** Is not null operator. */ - nn { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - String ruleFilter = propertyName + " is not null"; - return ruleFilter; - } - }, - /** Is among operator. */ - in { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - throw new UnsupportedOperationException(); - } - }, - /** Not is among operator. */ - ni { - @Override - public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) { - throw new UnsupportedOperationException(); - } - }; - - public abstract String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams); - } - - - public static FilterPagerBeanBuilder newFilterPagerBeanBuilder(String operationGroup) { - FilterOperationGroup operationGroup1 = FilterOperationGroup.valueOf(operationGroup); - FilterPagerBeanBuilder builder = new FilterPagerBeanBuilder(operationGroup1); - return builder; - } - - public static class FilterPagerBeanBuilder { - - protected final FilterOperationGroup groupOp; - - protected final List<FilterRule> rules; - - public FilterPagerBeanBuilder(FilterOperationGroup groupOp) { - this.groupOp = groupOp; - rules = new LinkedList<FilterRule>(); - } - - public FilterPagerBeanBuilder addOperations(Collection<Map<String, String>> operations) { - for (Map<String, String> operation : operations) { - addRule(operation); - } - return this; - } - - public FilterPagerBeanBuilder addRule(Map<String, String> ruleMap) { - String op = ruleMap.get("op"); - String property = ruleMap.get("field"); - String value = ruleMap.get("data"); - FilterOperation operator = FilterOperation.valueOf(op); - return addRule(new FilterRule(operator, property, value)); - } - - public FilterPagerBeanBuilder addRule(FilterRule rule) { - rules.add(rule); - return this; - } - - public void flush(FilterPagerBean bean) { - bean.setGroupOp(groupOp); - bean.setRules(rules); - } - - - } -} Modified: branches/topia-2.8.x-hibernate4/topia-persistence/src/test/java/org/nuiton/topia/framework/TopiaUtilTest.java =================================================================== --- branches/topia-2.8.x-hibernate4/topia-persistence/src/test/java/org/nuiton/topia/framework/TopiaUtilTest.java 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-persistence/src/test/java/org/nuiton/topia/framework/TopiaUtilTest.java 2013-04-08 14:44:16 UTC (rev 2707) @@ -101,6 +101,8 @@ boolean actual = TopiaUtil.isSchemaExist(rootContext, PersonImpl.class.getName()); + // FIXME echatellier 20130315 ce test fail depuis probablement a cause + // de hibernate.hbm2ddl.auto=update, à confirmer... assertFalse(actual); TopiaContext tx = rootContext.beginTransaction(); Modified: branches/topia-2.8.x-hibernate4/topia-service-migration/src/license/THIRD-PARTY.properties =================================================================== --- branches/topia-2.8.x-hibernate4/topia-service-migration/src/license/THIRD-PARTY.properties 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-service-migration/src/license/THIRD-PARTY.properties 2013-04-08 14:44:16 UTC (rev 2707) @@ -1,15 +1,19 @@ # Generated by org.codehaus.mojo.license.AddThirdPartyMojo #------------------------------------------------------------------------------- # Already used licenses in project : +# - Apache License 2.0 # - BSD License # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - Common Public License Version 1.0 +# - GNU Lesser General Public License, version 2.1 +# - GNU Library or Lesser General Public License # - Indiana University Extreme! Lab Software License, vesion 1.1.1 # - Lesser General Public License (LGPL) v 3.0 # - Lesser General Public License (LPGL) # - Lesser General Public License (LPGL) v 2.1 # - MIT License # - MPL 1.1 +# - New BSD License # - The Apache Software License, Version 2.0 # - The H2 License, Version 1.0 # - license.txt @@ -17,8 +21,6 @@ # Please fill the missing licenses for dependencies : # # -#Thu Aug 18 07:47:56 CEST 2011 -antlr--antlr--2.7.6=BSD License +#Fri Mar 15 12:42:01 CET 2013 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 dom4j--dom4j--1.6.1=BSD License -javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Modified: branches/topia-2.8.x-hibernate4/topia-service-replication/src/license/THIRD-PARTY.properties =================================================================== --- branches/topia-2.8.x-hibernate4/topia-service-replication/src/license/THIRD-PARTY.properties 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-service-replication/src/license/THIRD-PARTY.properties 2013-04-08 14:44:16 UTC (rev 2707) @@ -1,15 +1,19 @@ # Generated by org.codehaus.mojo.license.AddThirdPartyMojo #------------------------------------------------------------------------------- # Already used licenses in project : +# - Apache License 2.0 # - BSD License # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - Common Public License Version 1.0 +# - GNU Lesser General Public License, version 2.1 +# - GNU Library or Lesser General Public License # - Indiana University Extreme! Lab Software License, vesion 1.1.1 # - Lesser General Public License (LGPL) v 3.0 # - Lesser General Public License (LPGL) # - Lesser General Public License (LPGL) v 2.1 # - MIT License # - MPL 1.1 +# - New BSD License # - The Apache Software License, Version 2.0 # - The H2 License, Version 1.0 # - license.txt @@ -17,8 +21,6 @@ # Please fill the missing licenses for dependencies : # # -#Thu Aug 18 07:47:24 CEST 2011 -antlr--antlr--2.7.6=BSD License +#Fri Mar 15 12:41:29 CET 2013 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 dom4j--dom4j--1.6.1=BSD License -javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Modified: branches/topia-2.8.x-hibernate4/topia-service-security/src/license/THIRD-PARTY.properties =================================================================== --- branches/topia-2.8.x-hibernate4/topia-service-security/src/license/THIRD-PARTY.properties 2013-03-12 15:48:07 UTC (rev 2706) +++ branches/topia-2.8.x-hibernate4/topia-service-security/src/license/THIRD-PARTY.properties 2013-04-08 14:44:16 UTC (rev 2707) @@ -1,15 +1,19 @@ # Generated by org.codehaus.mojo.license.AddThirdPartyMojo #------------------------------------------------------------------------------- # Already used licenses in project : +# - Apache License 2.0 # - BSD License # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - Common Public License Version 1.0 +# - GNU Lesser General Public License, version 2.1 +# - GNU Library or Lesser General Public License # - Indiana University Extreme! Lab Software License, vesion 1.1.1 # - Lesser General Public License (LGPL) v 3.0 # - Lesser General Public License (LPGL) # - Lesser General Public License (LPGL) v 2.1 # - MIT License # - MPL 1.1 +# - New BSD License # - The Apache Software License, Version 2.0 # - The H2 License, Version 1.0 # - license.txt @@ -17,8 +21,6 @@ # Please fill the missing licenses for dependencies : # # -#Thu Aug 18 07:48:01 CEST 2011 -antlr--antlr--2.7.6=BSD License +#Fri Mar 15 12:42:13 CET 2013 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 dom4j--dom4j--1.6.1=BSD License -javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0