r3108 - in branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen: . entity service/legacy
Author: tchemit Date: 2012-01-23 23:27:46 +0100 (Mon, 23 Jan 2012) New Revision: 3108 Url: http://chorem.org/repositories/revision/pollen/3108 Log: depreciates and add a lot of FIXME to be done on model, rename PollenTopiaRootContextSupplierFactory to PollenTopiaRootContextFactory Added: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextFactory.java Removed: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextSupplierFactory.java Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenBusinessException.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenContext.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenException.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenProperty.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenUtils.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantDAOImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountDAOImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollDAOImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/VoteImpl.java branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/service/legacy/ServiceUser.java Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenBusinessException.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenBusinessException.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenBusinessException.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -36,6 +36,7 @@ * Mise a jour: $Date$ * par : $Author$ */ +@Deprecated public class PollenBusinessException extends Exception { private static final long serialVersionUID = 1L; Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenContext.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenContext.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenContext.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -30,7 +30,7 @@ import org.nuiton.topia.framework.EntityFilter; import org.nuiton.util.ApplicationConfig; - +@Deprecated public interface PollenContext { /** Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenException.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenException.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenException.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -24,7 +24,7 @@ package org.chorem.pollen; - +@Deprecated public class PollenException extends RuntimeException { protected Object[] args; Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenProperty.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenProperty.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenProperty.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -35,6 +35,7 @@ * Mise a jour: $Date$ * par : $Author$ */ +@Deprecated public enum PollenProperty { /** version of the application **/ APP_VERSION("version"), Copied: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextFactory.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextSupplierFactory.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextFactory.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextFactory.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -0,0 +1,126 @@ +/* + * #%L + * Pollen :: Persistence + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen; + +import com.google.common.collect.Sets; +import com.google.common.io.Closeables; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaContextFactory; +import org.nuiton.topia.TopiaNotFoundException; +import org.nuiton.topia.TopiaRuntimeException; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; +import java.util.Set; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class PollenTopiaRootContextFactory { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(PollenTopiaRootContextFactory.class); + + public TopiaContext newEmbeddedDatabase(File dir, String configPath) { + + File databaseFile = new File(dir, "db"); + + String databaseAbsolutePath = databaseFile.getAbsolutePath(); + + // prepare call to topia-context factory + Properties properties = new Properties(); + InputStream input = null; + try { + input = getClass().getResourceAsStream(configPath); + properties.load(input); + } catch (IOException e) { + throw new PollenTechnicalException(e); + } finally { + Closeables.closeQuietly(input); + } + properties.setProperty( + TopiaContextFactory.CONFIG_URL, + "jdbc:h2:file:" + databaseAbsolutePath + "/pollen"); + + // add entities to the context + properties.setProperty( + TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES, + PollenDAOHelper.getImplementationClassesAsString()); + + TopiaContext rootContext; + try { + rootContext = TopiaContextFactory.getContext(properties); + } catch (TopiaNotFoundException e) { + throw new TopiaRuntimeException(e); + } + + if (log.isDebugEnabled()) { + log.debug("will output database in " + databaseAbsolutePath); + } + + return rootContext; + } + + public TopiaContext newDatabaseFromConfig(PollenConfiguration config) { + + Properties properties = config.getProperties(); + + return newDatabaseFromProperties(properties); + } + + public TopiaContext newDatabaseFromProperties(Properties properties) { + + if (log.isDebugEnabled()) { + log.debug("Database settings are :"); + Set<String> keysToDisplay = Sets.newHashSet( + "hibernate.dialect", + "hibernate.connection.driver_class", + "hibernate.connection.url", + "hibernate.connection.username"); + for (String key : keysToDisplay) { + log.debug(String.format("%s=%s", key, properties.getProperty(key))); + } + } + + // add entities to the context + String classesKey = TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES; + String classesValue = PollenDAOHelper.getImplementationClassesAsString(); + properties.setProperty(classesKey, classesValue); + + TopiaContext rootContext; + try { + rootContext = TopiaContextFactory.getContext(properties); + } catch (TopiaNotFoundException e) { + throw new TopiaRuntimeException(e); + } + + return rootContext; + } +} Property changes on: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextFactory.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextSupplierFactory.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextSupplierFactory.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenTopiaRootContextSupplierFactory.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -1,127 +0,0 @@ -/* - * #%L - * Pollen :: Persistence - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen; - -import com.google.common.base.Supplier; -import com.google.common.collect.Sets; -import com.google.common.io.Closeables; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaContextFactory; -import org.nuiton.topia.TopiaNotFoundException; -import org.nuiton.topia.TopiaRuntimeException; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import java.util.Set; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class PollenTopiaRootContextSupplierFactory { - - /** Logger. */ - private static final Log log = - LogFactory.getLog(PollenTopiaRootContextSupplierFactory.class); - - public TopiaContext newEmbeddedDatabase(File dir, String configPath) { - - File databaseFile = new File(dir, "db"); - - String databaseAbsolutePath = databaseFile.getAbsolutePath(); - - // prepare call to topia-context factory - Properties properties = new Properties(); - InputStream input = null; - try { - input = getClass().getResourceAsStream(configPath); - properties.load(input); - } catch (IOException e) { - throw new PollenTechnicalException(e); - } finally { - Closeables.closeQuietly(input); - } - properties.setProperty( - TopiaContextFactory.CONFIG_URL, - "jdbc:h2:file:" + databaseAbsolutePath + "/pollen"); - - // add entities to the context - properties.setProperty( - TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES, - PollenDAOHelper.getImplementationClassesAsString()); - - TopiaContext rootContext; - try { - rootContext = TopiaContextFactory.getContext(properties); - } catch (TopiaNotFoundException e) { - throw new TopiaRuntimeException(e); - } - - if (log.isDebugEnabled()) { - log.debug("will output database in " + databaseAbsolutePath); - } - - return rootContext; - } - - public TopiaContext newDatabaseFromConfig(PollenConfiguration config) { - - Properties properties = config.getProperties(); - - return newDatabaseFromProperties(properties); - } - - public TopiaContext newDatabaseFromProperties(Properties properties) { - - if (log.isDebugEnabled()) { - log.debug("Database settings are :"); - Set<String> keysToDisplay = Sets.newHashSet( - "hibernate.dialect", - "hibernate.connection.driver_class", - "hibernate.connection.url", - "hibernate.connection.username"); - for (String key : keysToDisplay) { - log.debug(String.format("%s=%s", key, properties.getProperty(key))); - } - } - - // add entities to the context - String classesKey = TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES; - String classesValue = PollenDAOHelper.getImplementationClassesAsString(); - properties.setProperty(classesKey, classesValue); - - TopiaContext rootContext; - try { - rootContext = TopiaContextFactory.getContext(properties); - } catch (TopiaNotFoundException e) { - throw new TopiaRuntimeException(e); - } - - return rootContext; - } -} Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenUtils.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenUtils.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/PollenUtils.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -31,6 +31,7 @@ * @author fdesbois <fdesbois@codelutin.com> * @version $Id$ */ +@Deprecated public class PollenUtils { private static PollenContext context; Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -54,6 +54,7 @@ if (hidden && !previous) { setName(NumberMethod.HIDDEN_PREFIX + name); } else if (!hidden && previous) { + //FIXME tchemit-20120123 This does nothing ! name.substring(NumberMethod.HIDDEN_PREFIX.length()); } } Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -23,9 +23,9 @@ */ package org.chorem.pollen.entity; +import com.google.common.collect.Lists; import org.chorem.pollen.PollenBusinessException; -import java.util.ArrayList; import java.util.Collection; /** @@ -40,20 +40,25 @@ @Override public Collection<Participant> getParticipants() { - Collection<Participant> results = new ArrayList<Participant>(); + Collection<Participant> results = Lists.newArrayList(); for (FavoriteParticipant account : getFavoriteParticipant()) { results.add(account); } return results; } + //FIXME tchemit-20120123 Remove this, use a service for this purpose + @Deprecated @Override public void setParticipants(Collection<Participant> participants) throws PollenBusinessException { - setFavoriteParticipant(new ArrayList<FavoriteParticipant>()); + Collection<FavoriteParticipant> list = Lists.newArrayList(); + setFavoriteParticipant(list); ParticipantHelper.setParticipants(this, participants); } + //FIXME tchemit-20120123 : No! please do not use a gentle string error return code : Cobol age is now over :( Do this in a service + @Deprecated @Override public String addParticipant(Participant participant) { String name = participant.getName(); @@ -74,6 +79,8 @@ return null; } + //FIXME tchemit-20120123 Remove this, entity is not a DTO + @Deprecated @Override public String getId() { return getTopiaId(); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantDAOImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantDAOImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantDAOImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -37,6 +37,7 @@ public class FavoriteParticipantDAOImpl<E extends FavoriteParticipant> extends FavoriteParticipantDAOAbstract<E> { + //FIXME tchemit 20120123 Rethink this to avoid floating code with filter..., prefer to add explicit method for explicit purposes... @Override public TopiaQuery createQueryFindAllByFavoriteList(EntityFilter filter) { Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/FavoriteParticipantImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -33,6 +33,8 @@ private static final long serialVersionUID = 1L; + //FIXME tchemit-20120123 Remove this, entity is not a DTO + @Deprecated @Override public String getId() { return getTopiaId(); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -37,6 +37,8 @@ * @see Participant * @see ParticipantList */ +//FIXME tchemit-20120123 Remove this, use a service instead and please no gentle string return code : Cobol age is over :( +@Deprecated public class ParticipantHelper { private static final Log log = LogFactory.getLog(ParticipantHelper.class); @@ -51,6 +53,8 @@ * @return an error code if participant already exist : simply the * concatenation of name and email. */ + //FIXME tchemit-20120123 : oups, this is bad, bad, bad :( + @Deprecated public static String checkParticipantExist( ParticipantList list, String name, String email) { for (Participant participant : list.getParticipants()) { @@ -77,6 +81,8 @@ * @param participants to add to the list * @throws PollenBusinessException for doubloons case */ + //FIXME tchemit-20120123 : oups, this is bad, bad, bad :( + @Deprecated public static void setParticipants(ParticipantList list, Collection<Participant> participants) throws PollenBusinessException { @@ -93,7 +99,7 @@ doubloons.append(separator).append(doubloon); } else if (log.isDebugEnabled()) { log.debug("Participant added : " + participant.getName() + - " _ " + participant.getEmail()); + " _ " + participant.getEmail()); } } // If doubloons are found, throw an exception Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountDAOImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountDAOImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountDAOImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -35,6 +35,7 @@ */ public class PollAccountDAOImpl<E extends PollAccount> extends PollAccountDAOAbstract<E> { + //FIXME tchemit 20120123 Rethink this to avoid floating code with filter..., prefer to add explicit method for explicit purposes... @Override public TopiaQuery createQueryFindAllByPoll(EntityFilter filter) { @@ -78,6 +79,7 @@ return query; } + //FIXME tchemit 20120123 Rethink this to avoid floating code with filter..., prefer to add explicit method for explicit purposes... @Override public TopiaQuery createQueryFindAllParticipantsByPoll(Poll poll) { @@ -116,7 +118,7 @@ // Manage join depends on pollType if (poll.getType().isGroup()) { query.addJoin(pollProperty.pollAccount(), listProperty.$alias(), false). - addJoin(listProperty.child(), participantProperty.$alias(), false); + addJoin(listProperty.child(), participantProperty.$alias(), false); } else { query.addJoin(pollProperty.pollAccount(), participantProperty.$alias(), false); } Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -53,6 +53,8 @@ return results; } + //FIXME tchemit-20120123 Remove this, use a service for this purpose + @Deprecated @Override public void setParticipants(Collection<Participant> participants) throws PollenBusinessException { @@ -64,6 +66,8 @@ ParticipantHelper.setParticipants(this, participants); } + //FIXME tchemit-20120123 Remove this, use a service for this purpose + @Deprecated @Override public String addParticipant(Participant participant) { String name = participant.getName(); @@ -83,6 +87,8 @@ return null; } + //FIXME tchemit-20120123 Remove this, entity is not a DTO + @Deprecated @Override public String getId() { return getTopiaId(); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollDAOImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollDAOImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollDAOImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -37,6 +37,7 @@ */ public class PollDAOImpl<E extends Poll> extends PollDAOAbstract<E> { + //FIXME tchemit 20120123 Rethink this to avoid floating code with filter..., prefer to add explicit method for explicit purposes... @Override public TopiaQuery createQueryFindAllByUser(EntityFilter filter) throws IllegalArgumentException { @@ -45,11 +46,11 @@ filter.checkReference(UserAccount.class, false); PollProperty pollProperty = - PollenQueryHelper.newPollProperty(); + PollenQueryHelper.newPollProperty(); PollAccountProperty listProperty = - PollenQueryHelper.newPollAccountProperty(); + PollenQueryHelper.newPollAccountProperty(); PollAccountProperty participantProperty = - PollenQueryHelper.newPollAccountChildProperty(); + PollenQueryHelper.newPollAccountChildProperty(); // participantUser is the reference to filter on if necessary filter.setReferenceProperty(participantProperty.userAccount()); @@ -59,11 +60,11 @@ addLeftJoin(pollProperty.pollAccount(), listProperty.$alias(), false). addFrom(PollAccount.class, participantProperty.$alias()). addWhere(String.format( - "%1$s IN (%2$s) OR %1$s IN elements(%3$s) OR %1$s = %4$s", - participantProperty.$alias(), - listProperty.$alias(), - listProperty.child(), - pollProperty.creator()) + "%1$s IN (%2$s) OR %1$s IN elements(%3$s) OR %1$s = %4$s", + participantProperty.$alias(), + listProperty.$alias(), + listProperty.child(), + pollProperty.creator()) ). addFilter(filter); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/PollImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -54,18 +54,21 @@ return choice; } + @Deprecated @Override public boolean isStarted() { Date now = PollenUtils.getCurrentDate(); return isStarted(now); } + @Deprecated @Override public boolean isFinished() { Date now = PollenUtils.getCurrentDate(); return isFinished(now); } + @Deprecated @Override public boolean isRunning() { Date now = PollenUtils.getCurrentDate(); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -28,19 +28,20 @@ /** * UserAccountImpl - * + * <p/> * Created: 30 mars 2010 * * @author fdesbois * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ + * <p/> + * Mise a jour: $Date$ + * par : $Author$ */ public class UserAccountImpl extends UserAccountAbstract { private static final long serialVersionUID = 1L; + @Deprecated protected String newPassword; /** @@ -48,6 +49,7 @@ * * @return the value of newPassword */ + @Deprecated @Override public String getNewPassword() { return newPassword; @@ -58,6 +60,7 @@ * * @param newPassword new value of newPassword */ + @Deprecated @Override public void setNewPassword(String newPassword) { this.newPassword = newPassword; @@ -69,7 +72,7 @@ String separator = ""; if (StringUtils.isNotEmpty(getFirstName())) { name += getFirstName(); - separator = " "; + separator = " "; } if (StringUtils.isNotEmpty(getLastName())) { name += separator + getLastName(); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/VoteImpl.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/VoteImpl.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/entity/VoteImpl.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -26,19 +26,20 @@ /** * VoteImpl - * + * <p/> * Created: 23 mars 2010 * * @author fdesbois * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ + * <p/> + * Mise a jour: $Date$ + * par : $Author$ */ public class VoteImpl extends VoteAbstract { private static final long serialVersionUID = 1L; + //FIXME tchemit-20120123 needed ? @Override public boolean canUpdateVote(PollAccount person) { throw new UnsupportedOperationException("Not supported yet."); Modified: branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/service/legacy/ServiceUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/service/legacy/ServiceUser.java 2012-01-23 17:32:00 UTC (rev 3107) +++ branches/pollen-2.0-beta-1/pollen-persistence/src/main/java/org/chorem/pollen/service/legacy/ServiceUser.java 2012-01-23 22:27:46 UTC (rev 3108) @@ -29,6 +29,7 @@ import org.chorem.pollen.entity.UserAccount; import org.nuiton.topia.framework.EntityFilter; +@Deprecated public interface ServiceUser { UserAccount connect(String login, String password) throws PollenException, PollenBusinessException;
participants (1)
-
tchemit@users.chorem.org