Remove unused classes
git-svn-id: https://svn.apache.org/repos/asf/continuum/branches/continuum-jpa-evenisse@652557 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/continuum/store/api/DeprecatedSystemStore.java b/src/main/java/org/apache/continuum/store/api/DeprecatedSystemStore.java
deleted file mode 100644
index d1df57e..0000000
--- a/src/main/java/org/apache/continuum/store/api/DeprecatedSystemStore.java
+++ /dev/null
@@ -1,207 +0,0 @@
-package org.apache.continuum.store.api;
-
-import java.util.List;
-
-import org.apache.continuum.model.project.Schedule;
-import org.apache.continuum.model.system.Installation;
-import org.apache.continuum.model.system.Profile;
-import org.apache.continuum.model.system.SystemConfiguration;
-
-/**
- * Defines the contract consisting of operations that can be performed on following entities:
- * <ul>
- * <li>{@link Schedule},</li>
- * <li>{@link Profile},</li>
- * <li>{@link Installation},</li>
- * <li>{@link SystemConfiguration}</li>
- * </ul>
- *
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.1
- */
-public interface DeprecatedSystemStore
-{
- public static final String ROLE = DeprecatedSystemStore.class.getName();
-
- /**
- * Removes the passed {@link Installation} instance from the underlying store.
- *
- * @param project
- * {@link Installation} instance to remove.
- * @throws StoreException
- * if there was an error removing the entity.
- */
- public void deleteInstallation( Installation installation ) throws StoreException;
-
- /**
- * Removes the passed {@link Profile} instance from the underlying store.
- *
- * @param project
- * {@link Profile} instance to remove.
- * @throws StoreException
- * if there was an error removing the entity.
- */
- public void deleteProfile( Profile profile ) throws StoreException;
-
- /**
- * Removes the passed {@link Schedule} instance from the underlying store.
- *
- * @param project
- * {@link Schedule} instance to remove.
- * @throws StoreException
- * if there was an error removing the entity.
- */
- public void deleteSchedule( Schedule schedule ) throws StoreException;
-
- /**
- * Removes the passed {@link SystemConfiguration} instance from the underlying store.
- *
- * @param project
- * {@link SystemConfiguration} instance to remove.
- * @throws StoreException
- * if there was an error removing the entity.
- */
- public void deleteSystemConfiguration( SystemConfiguration systemConfiguration ) throws StoreException;
-
- /**
- * Looks up the underlying store and returns a {@link Installation} instance that matches the specified id.
- *
- * @param id
- * {@link Installation} id to match.
- * @return matching {@link Installation} instance.
- * @throws EntityNotFoundException
- * if the instance could not be looked up.
- * @throws StoreException
- */
- public Installation lookupInstallation( long id ) throws EntityNotFoundException, StoreException;
-
- /**
- * Looks up the underlying store and returns a {@link Profile} instance that matches the specified id.
- *
- * @param id
- * {@link Profile} id to match.
- * @return matching {@link Profile} instance.
- * @throws EntityNotFoundException
- * if the instance could not be looked up.
- * @throws StoreException
- */
- public Profile lookupProfile( long id ) throws EntityNotFoundException, StoreException;
-
- /**
- * Looks up the underlying store and returns a {@link Schedule} instance that matches the specified id.
- *
- * @param id
- * {@link Schedule} id to match.
- * @return matching {@link Schedule} instance.
- * @throws EntityNotFoundException
- * if the instance could not be looked up.
- * @throws StoreException
- */
- public Schedule lookupSchedule( long id ) throws EntityNotFoundException, StoreException;
-
- /**
- * Looks up the underlying store and returns a {@link SystemConfiguration} instance that matches the specified id.
- *
- * @param id
- * {@link SystemConfiguration} id to match.
- * @return matching {@link SystemConfiguration} instance.
- * @throws EntityNotFoundException
- * if the instance could not be looked up.
- * @throws StoreException
- */
- public SystemConfiguration lookupSystemConfiguration( long id ) throws EntityNotFoundException, StoreException;
-
- /**
- * Persists the passed in {@link Installation} instance to the underlying store.
- * <p>
- * If the entity instance already exists in the database it is updated, else a new instance is created and an
- * store-generated identifier assigned to it.
- *
- * @param project
- * {@link Installation} instance to be created/saved.
- * @return updated {@link Installation} instance.
- * @throws StoreException
- * if there was an error saving the entity.
- */
- public Installation saveInstallation( Installation installation ) throws StoreException;
-
- /**
- * Persists the passed in {@link Profile} instance to the underlying store.
- * <p>
- * If the entity instance already exists in the database it is updated, else a new instance is created and an
- * store-generated identifier assigned to it.
- *
- * @param project
- * {@link Profile} instance to be created/saved.
- * @return updated {@link Profile} instance.
- * @throws StoreException
- * if there was an error saving the entity.
- */
- public Profile saveProfile( Profile profile ) throws StoreException;
-
- /**
- * Persists the passed in {@link Schedule} instance to the underlying store.
- * <p>
- * If the entity instance already exists in the database it is updated, else a new instance is created and an
- * store-generated identifier assigned to it.
- *
- * @param project
- * {@link Schedule} instance to be created/saved.
- * @return updated {@link Schedule} instance.
- * @throws StoreException
- * if there was an error saving the entity.
- */
- public Schedule saveSchedule( Schedule schedule ) throws StoreException;
-
- /**
- * Persists the passed in {@link SystemConfiguration} instance to the underlying store.
- * <p>
- * If the entity instance already exists in the database it is updated, else a new instance is created and an
- * store-generated identifier assigned to it.
- *
- * @param project
- * {@link SystemConfiguration} instance to be created/saved.
- * @return updated {@link SystemConfiguration} instance.
- * @throws StoreException
- * if there was an error saving the entity.
- */
- public SystemConfiguration saveSystemConfiguration( SystemConfiguration systemConfiguration ) throws StoreException;
-
- /**
- * Obtains and returns a {@link List} of <b>all</b> {@link Schedule} instances for the system, stored in the
- * underlying store.
- *
- * @return list of all {@link Schedule} instances stored.
- * @throws StoreException
- */
- public List getAllSchedules() throws StoreException;
-
- /**
- * Obtains and returns a {@link List} of <b>all</b> {@link Profile} instances for the system, stored in the
- * underlying store.
- *
- * @return list of all {@link Profile} instances stored.
- * @throws StoreException
- */
- public List getAllProfiles() throws StoreException;
-
- /**
- * Obtains and returns a {@link List} of <b>all</b> {@link Installation} instances for the system, stored in the
- * underlying store.
- *
- * @return list of all {@link Installation} instances stored.
- * @throws StoreException
- */
- public List getAllInstallations() throws StoreException;
-
- /**
- * Obtains and returns a {@link List} of <b>all</b> {@link SystemConfiguration} instances for the system, stored in
- * the underlying store.
- *
- * @return list of all {@link SystemConfiguration} instances stored.
- * @throws StoreException
- */
- public List getAllSystemConfigurations() throws StoreException;
-
-}
diff --git a/src/main/java/org/apache/continuum/store/api/EntityNotFoundException.java b/src/main/java/org/apache/continuum/store/api/EntityNotFoundException.java
deleted file mode 100644
index 7eff923..0000000
--- a/src/main/java/org/apache/continuum/store/api/EntityNotFoundException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.continuum.store.api;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
- * @version $Id$
- */
-public class EntityNotFoundException extends StoreException
-{
- public EntityNotFoundException()
- {
- super();
- }
-
- public EntityNotFoundException( String message )
- {
- super( message );
- }
-
- public EntityNotFoundException( String type, String id )
- {
- this( "Could not find object. Type '" + type + "'. Id: '" + id + "'." );
- }
-}
diff --git a/src/main/java/org/apache/continuum/store/api/Query.java b/src/main/java/org/apache/continuum/store/api/Query.java
deleted file mode 100644
index d4e1eb5..0000000
--- a/src/main/java/org/apache/continuum/store/api/Query.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.api;
-
-import java.util.Map;
-
-/**
- * Wraps up Type Query criteria to be used by store extensions to filter (and obtain) matching type instances.
- * <p>
- * Implementations/extensions are expected to override {@link Object#toString()} method and return a <b>JPQL</b>
- * formatted string. The JPQL string is consumed by the {@link Store} implementation in {@link Store#query(Query)}
- * operations.
- *
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public interface Query<Q>
-{
-
- /**
- * Returns this instance of {@link Query} as a JPQL String.
- *
- * @param whereClause
- * {@link Map} containing the named parameters to be substituted in the JPQL query. This is populated by
- * the {@link Query} implementation and subsequently used by the {@link Store} implementation to
- * interpolate the parameters before the JPQL query is executed.
- *
- * @return {@link Query} as a JPQL String
- */
- public String toString( Map<String, Object> whereClause );
-}
diff --git a/src/main/java/org/apache/continuum/store/api/QueryFactory.java b/src/main/java/org/apache/continuum/store/api/QueryFactory.java
deleted file mode 100644
index bcd8c3c..0000000
--- a/src/main/java/org/apache/continuum/store/api/QueryFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.api;
-
-/**
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public class QueryFactory
-{
- public static <T, Q extends Query<T>> Q createQuery( Class<Q> klass )
- {
- Q qry = null;
- try
- {
- qry = klass.newInstance();
- }
- catch ( InstantiationException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch ( IllegalAccessException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return qry;
- }
-}
diff --git a/src/main/java/org/apache/continuum/store/api/Store.java b/src/main/java/org/apache/continuum/store/api/Store.java
deleted file mode 100644
index c74453d..0000000
--- a/src/main/java/org/apache/continuum/store/api/Store.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.api;
-
-import java.util.List;
-
-import org.apache.continuum.model.CommonUpdatableEntity;
-
-/**
- * Interface that Continuum store extensions/implementations are expected to implement to allow operations on the
- * underlying store.
- * <ul>
- * <li>Entity look ups</li>
- * <li>Entity insert/updates</li>
- * <li>Entity removal</li>
- * <li>Querying one or more entity/entities based on specified criteria</li>
- * </ul>
- *
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public interface Store<T extends CommonUpdatableEntity, Q extends Query<T>>
-{
-
- /**
- * Looks up the underlying store and returns a {@link T} instance that matches the specified id.
- *
- * @param klass
- * {@link Class} for type entity to lookup and return an instance of.
- * @param id
- * Entity Type {@link T}'s id to match.
- *
- * @return matching entity type {@link T} instance.
- * @throws StoreException
- * @throws EntityNotFoundException
- * if the entity specified by the identifier could be located in the system.
- * @throws EntityNotFoundException
- * if the instance could not be looked up.
- */
- public T lookup( Class<T> klass, Long id ) throws StoreException, EntityNotFoundException;
-
- /**
- * Persists the passed in entity type {@link T} instance to the underlying store.
- * <p>
- * If the entity instance already exists in the database it is updated, else a new instance is created and an
- * store-generated identifier assigned to it.
- *
- * @param entity
- * Type {@link T} instance to be created/saved.
- * @return updated entity type {@link T} instance.
- * @throws StoreException
- * if there was an error saving the entity.
- */
- public T save( T entity ) throws StoreException;
-
- /**
- * Removes the passed entity type {@link T} instance from the underlying store.
- *
- * @param entity
- * Type {@link T} instance to remove.
- * @throws StoreException
- * if there was an error removing the entity.
- */
- public void delete( T entity ) throws StoreException;
-
- /**
- * Obtains a {@link List} of instances of entity type {@link T} which match the criteria specified by the passed in
- * query instance.
- *
- * @param query
- * instance that wraps up the criteria for querying matching instances in the system.
- * @return {@link List} of instances of entity type {@link T} which match the specified query.
- * @throws StoreException
- */
- public List<T> query( Q query ) throws StoreException;
-
-}
diff --git a/src/main/java/org/apache/continuum/store/jpa/JpaStore.java b/src/main/java/org/apache/continuum/store/jpa/JpaStore.java
deleted file mode 100644
index 318e9b4..0000000
--- a/src/main/java/org/apache/continuum/store/jpa/JpaStore.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.jpa;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.continuum.model.CommonUpdatableEntity;
-import org.apache.continuum.store.api.EntityNotFoundException;
-import org.apache.continuum.store.api.Query;
-import org.apache.continuum.store.api.Store;
-import org.apache.continuum.store.api.StoreException;
-import org.springframework.orm.jpa.JpaObjectRetrievalFailureException;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public class JpaStore<T extends CommonUpdatableEntity, Q extends Query<T>> extends StoreSupport implements Store<T, Q>
-{
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Store#delete(java.lang.Object)
- */
- @Transactional( readOnly = false )
- public void delete( T entity ) throws StoreException
- {
- getJpaTemplate().remove( entity );
- }
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Store#lookup(Class, java.lang.Long)
- */
- public T lookup( Class<T> klass, Long id ) throws StoreException, EntityNotFoundException
- {
- if ( id == null )
- throw new EntityNotFoundException();
- T entity = null;
- try
- {
- entity = getJpaTemplate().find( klass, id );
- }
- catch ( JpaObjectRetrievalFailureException e )
- {
- throw new EntityNotFoundException();
- }
- if ( entity == null )
- throw new EntityNotFoundException();
- return entity;
- }
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Store#query(org.apache.continuum.store.api.Query)
- */
- public List<T> query( Q query ) throws StoreException
- {
- Map<String, Object> where = new HashMap<String, Object>();
- String q = query.toString( where );
-
- List<T> results = find( q, where, 0, 0 );
-
- return results;
- }
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Store#save(java.lang.Object)
- */
- @Transactional( readOnly = true )
- public T save( T entity ) throws StoreException
- {
- if ( null != entity )
- {
- if ( null == entity.getId() )
- getJpaTemplate().persist( entity );
- else
- entity = getJpaTemplate().merge( entity );
- }
- return entity;
- }
-
-}
diff --git a/src/main/java/org/apache/continuum/store/jpa/JpaStoreFactory.java b/src/main/java/org/apache/continuum/store/jpa/JpaStoreFactory.java
deleted file mode 100644
index 4824527..0000000
--- a/src/main/java/org/apache/continuum/store/jpa/JpaStoreFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.jpa;
-
-import org.apache.continuum.model.project.Project;
-import org.apache.continuum.model.project.ProjectGroup;
-import org.apache.continuum.model.project.ProjectNotifier;
-import org.apache.continuum.store.api.Store;
-
-/**
- * Bean factory that is used by Spring container to create and return instances of {@link Store} implementations.
- *
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public class JpaStoreFactory
-{
-
- /**
- * Store instance that services executes requests on underlying store for {@link Project} entities.
- */
- private final JpaStore<Project, ProjectQuery<Project>> JPA_PROJECT_STORE =
- new JpaStore<Project, ProjectQuery<Project>>();
-
- /**
- * Store instance that services executes requests on underlying store for {@link ProjectGroup} entities.
- */
- private final JpaStore<ProjectGroup, ProjectGroupQuery<ProjectGroup>> JPA_PROJECT_GROUP_STORE =
- new JpaStore<ProjectGroup, ProjectGroupQuery<ProjectGroup>>();
-
- /**
- * Store instance that services executes requests on underlying store for {@link ProjectNotifier} entities.
- */
- private final JpaStore<ProjectNotifier, ProjectNotifierQuery<ProjectNotifier>> JPA_PROJECT_NOTIFIER_STORE =
- new JpaStore<ProjectNotifier, ProjectNotifierQuery<ProjectNotifier>>();
-
- /**
- * Returns a {@link Store} instance to service {@link Project} Entity.
- *
- * @return a {@link Store} instance to service {@link Project} Entity
- */
- public Store<Project, ProjectQuery<Project>> createProjectGroupStoreInstance()
- {
- return JPA_PROJECT_STORE;
- }
-
- /**
- * Returns a {@link Store} instance to service {@link ProjectGroup} Entity.
- *
- * @return a {@link Store} instance to service {@link ProjectGroup} Entity.
- */
- public Store<ProjectGroup, ProjectGroupQuery<ProjectGroup>> createProjectStoreInstance()
- {
- return JPA_PROJECT_GROUP_STORE;
- }
-
- /**
- * Returns a {@link Store} instance to service {@link ProjectNotifier} Entity.
- *
- * @return a {@link Store} instance to service {@link ProjectNotifier} Entity.
- */
- public Store<ProjectNotifier, ProjectNotifierQuery<ProjectNotifier>> createProjectNotifierStoreInstance()
- {
-
- return JPA_PROJECT_NOTIFIER_STORE;
- }
-
-}
diff --git a/src/main/java/org/apache/continuum/store/jpa/ProjectGroupQuery.java b/src/main/java/org/apache/continuum/store/jpa/ProjectGroupQuery.java
deleted file mode 100644
index 7d4999c..0000000
--- a/src/main/java/org/apache/continuum/store/jpa/ProjectGroupQuery.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.jpa;
-
-import java.util.Date;
-import java.util.Map;
-
-import org.apache.continuum.store.api.Query;
-
-/**
- * Wraps up retrieval criteria for {@link ProjectGroup}s.
- *
- * @author <a href='mailto:rinku@apache.org'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public class ProjectGroupQuery<ProjectGroup> implements Query<ProjectGroup>
-{
-
- /**
- * ProjectGroup creation date criteria.
- */
- private Date dateCreated;
-
- /**
- * ProjectGroup update date criteria.
- */
- private Date dateUpdated;
-
- /**
- * ProjectGroup description criteria.
- */
- private String description;
-
- /**
- * ProjectGroup groupId criteria.
- */
- private String groupId;
-
- /**
- * ProjectGroup Id criteria.
- */
- private Long id;
-
- /**
- * ProjectGroup model encoding criteria.
- */
- private String modelEncoding;
-
- /**
- * ProjectGroup name criteria.
- */
- private String name;
-
- /**
- * @return
- *
- */
- public Date getDateCreated()
- {
- return this.dateCreated;
- }
-
- /**
- * @return
- * @see org.apache.continuum.model.CommonUpdatableEntity#getDateUpdated()
- */
- public Date getDateUpdated()
- {
- return this.dateUpdated;
- }
-
- /**
- * @return
- *
- */
- public String getDescription()
- {
- return this.description;
- }
-
- /**
- * @return
- *
- */
- public String getGroupId()
- {
- return this.groupId;
- }
-
- /**
- * Determine if a date of creation was specified in the query.
- *
- * @return <code>true</code> if a date of creation was specified, else <code>false</code>.
- */
- public boolean hasDateCreated()
- {
- return ( null != this.dateCreated );
- }
-
- /**
- * Determine if an update date was specified in the query.
- *
- * @return <code>true</code> if a date of update was specified, else <code>false</code>.
- */
- public boolean hasDateUpdated()
- {
- return ( null != this.dateUpdated );
- }
-
- /**
- * Determine if there was a Project Group 'description' specified in the query.
- *
- * @return <code>true</code> if there was a Project Group 'description' specified , else <code>false</code>.
- */
- public boolean hasDescription()
- {
- return ( null != this.description && this.description.length() > 0 );
- }
-
- /**
- * Determine if there was a Group Id for the {@link ProjectGroup} specified in the query.
- *
- * @return <code>true</code> if there was a Group Id for the {@link ProjectGroup} specified, else
- * <code>false</code>.
- */
- public boolean hasGroupId()
- {
- return ( null != this.groupId && this.groupId.length() > 0 );
- }
-
- /**
- *
- * @return
- */
- public boolean hasId()
- {
- return ( null != this.id && this.id.longValue() > 0L );
- }
-
- /**
- * Determine if there was a model encoding specified in the query.
- *
- * @return <code>true</code> if there was a model encoding specified, else <code>false</code>.
- */
- public boolean hasModelEncoding()
- {
- return ( null != this.modelEncoding && this.modelEncoding.length() > 0 );
- }
-
- /**
- * Determine if there is a {@link ProjectGroup} name specified in the query.
- *
- * @return <code>true</code> if there is a {@link ProjectGroup} name specified, else <code>false</code>.
- */
- public boolean hasName()
- {
- return ( null != this.name && this.name.length() > 0 );
- }
-
- /**
- * @return
- */
- public Long getId()
- {
- return this.id;
- }
-
- /**
- * @return
- */
- public String getModelEncoding()
- {
- return this.modelEncoding;
- }
-
- /**
- * @return
- */
- public String getName()
- {
- return this.name;
- }
-
- /**
- * @param dateCreated
- */
- public void setDateCreated( Date dateCreated )
- {
- this.dateCreated = dateCreated;
- }
-
- /**
- * @param dateUpdated
- */
- public void setDateUpdated( Date dateUpdated )
- {
- this.dateUpdated = dateUpdated;
- }
-
- /**
- * @param description
- */
- public void setDescription( String description )
- {
- this.description = description;
- }
-
- /**
- * @param groupId
- */
- public void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- /**
- * @param id
- */
- public void setId( Long id )
- {
- this.id = id;
- }
-
- /**
- * @param modelEncoding
- */
- public void setModelEncoding( String modelEncoding )
- {
- this.modelEncoding = modelEncoding;
- }
-
- /**
- * @param name
- */
- public void setName( String name )
- {
- this.name = name;
- }
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Query#toString(java.util.Map)
- */
- public String toString( Map<String, Object> whereClause )
- {
- StringBuffer sb = new StringBuffer();
-
- if ( this.hasId() )
- {
- whereClause.put( "id", this.getId() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.id =:id " );
- }
- if ( this.hasDateCreated() )
- {
- whereClause.put( "dateCreated", this.getDateCreated() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.dateCreated =:dateCreated " );
- }
- if ( this.hasDateUpdated() )
- {
- whereClause.put( "dateUpdated", this.getDateUpdated() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.dateUpdated =:dateUpdated " );
- }
- if ( this.hasDescription() )
- {
- whereClause.put( "description", this.getDescription() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.description =:description " );
- }
- if ( this.hasGroupId() )
- {
- whereClause.put( "groupId", this.getGroupId() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.groupId =:groupId " );
- }
- if ( this.hasModelEncoding() )
- {
- whereClause.put( "modelEncoding", this.getModelEncoding() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.modelEncoding =:modelEncoding " );
- }
- if ( this.hasName() )
- {
- whereClause.put( "name", this.getName() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " projectGroup.name =:name " );
- }
-
- if ( sb.length() > 0 )
- sb.insert( 0, " where " );
- sb.insert( 0, "select projectGroup from ProjectGroup as projectGroup " );
-
- return sb.toString();
- }
-
-}
diff --git a/src/main/java/org/apache/continuum/store/jpa/ProjectNotifierQuery.java b/src/main/java/org/apache/continuum/store/jpa/ProjectNotifierQuery.java
deleted file mode 100644
index 08312b1..0000000
--- a/src/main/java/org/apache/continuum/store/jpa/ProjectNotifierQuery.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.jpa;
-
-import java.util.Date;
-import java.util.Map;
-
-import org.apache.continuum.model.project.Project;
-import org.apache.continuum.model.project.ProjectGroup;
-import org.apache.continuum.store.api.Query;
-
-/**
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public class ProjectNotifierQuery<ProjectNotifier> implements Query<ProjectNotifier>
-{
-
- /**
- * ProjectNotifier creation date criteria.
- */
- private Date dateCreated;
-
- /**
- * ProjectNotifier update date criteria.
- */
- private Date dateUpdated;
-
- /**
- * ProjectNotifier Id criteria.
- */
- private Long id;
-
- /**
- * Determines if a ProjectNotifier is set up on a {@link Project} or a {@link ProjectGroup}.
- */
- private boolean isDefinedOnProject = false;
-
- /**
- * Determines if a {@link ProjectNotifier} is defined by a user.
- */
- private boolean isUserDefined = false;
-
- /**
- * ProjectNotifier model encoding criteria.
- */
- private String modelEncoding;
-
- /**
- * @return
- *
- */
- public Date getDateCreated()
- {
- return this.dateCreated;
- }
-
- /**
- * @return
- * @see org.apache.continuum.model.CommonUpdatableEntity#getDateUpdated()
- */
- public Date getDateUpdated()
- {
- return this.dateUpdated;
- }
-
- /**
- * @return
- */
- public Long getId()
- {
- return this.id;
- }
-
- /**
- * @return
- */
- public String getModelEncoding()
- {
- return this.modelEncoding;
- }
-
- /**
- * Determine if a date of creation was specified in the query.
- *
- * @return <code>true</code> if a date of creation was specified, else <code>false</code>.
- */
- public boolean hasDateCreated()
- {
- return ( null != this.dateCreated );
- }
-
- /**
- * Determine if an update date was specified in the query.
- *
- * @return <code>true</code> if a date of update was specified, else <code>false</code>.
- */
- public boolean hasDateUpdated()
- {
- return ( null != this.dateUpdated );
- }
-
- /**
- *
- * @return
- */
- public boolean hasId()
- {
- return ( null != this.id && this.id.longValue() > 0L );
- }
-
- /**
- * Determine if there was a model encoding specified in the query.
- *
- * @return <code>true</code> if there was a model encoding specified, else <code>false</code>.
- */
- public boolean hasModelEncoding()
- {
- return ( null != this.modelEncoding && this.modelEncoding.length() > 0 );
- }
-
- /**
- * @return the isDefinedOnProject
- */
- public boolean isDefinedOnProject()
- {
- return isDefinedOnProject;
- }
-
- /**
- * @return the isUserDefined
- */
- public boolean isUserDefined()
- {
- return isUserDefined;
- }
-
- /**
- * @param dateCreated
- */
- public void setDateCreated( Date dateCreated )
- {
- this.dateCreated = dateCreated;
- }
-
- /**
- * @param dateUpdated
- */
- public void setDateUpdated( Date dateUpdated )
- {
- this.dateUpdated = dateUpdated;
- }
-
- /**
- * @param isDefinedOnProject
- * the isDefinedOnProject to set
- */
- public void setDefinedOnProject( boolean isDefinedOnProject )
- {
- this.isDefinedOnProject = isDefinedOnProject;
- }
-
- /**
- * @param id
- */
- public void setId( Long id )
- {
- this.id = id;
- }
-
- /**
- * @param modelEncoding
- */
- public void setModelEncoding( String modelEncoding )
- {
- this.modelEncoding = modelEncoding;
- }
-
- /**
- * @param isUserDefined
- * the isUserDefined to set
- */
- public void setUserDefined( boolean isUserDefined )
- {
- this.isUserDefined = isUserDefined;
- }
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Query#toString(java.util.Map)
- */
- public String toString( Map<String, Object> whereClause )
- {
- StringBuffer sb = new StringBuffer();
-
- if ( this.hasId() )
- {
- whereClause.put( "id", this.getId() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " notifier.id =:id " );
- }
- if ( this.hasDateCreated() )
- {
- whereClause.put( "dateCreated", this.getDateCreated() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " notifier.dateCreated =:dateCreated " );
- }
- if ( this.hasDateUpdated() )
- {
- whereClause.put( "dateUpdated", this.getDateUpdated() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " notifier.dateUpdated =:dateUpdated " );
- }
- if ( this.hasModelEncoding() )
- {
- whereClause.put( "modelEncoding", this.getModelEncoding() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " notifier.modelEncoding =:modelEncoding " );
- }
- if ( this.isDefinedOnProject() )
- {
- // TODO: Implement!
- // Need to check what property is setup on the Notifier.
- // May need to add a property ORM mapping to persist.
- }
- if ( this.isUserDefined() )
- {
- // TODO: Implement!
- // Need to check what property is setup on the Notifier.
- // May need to add a property ORM mapping to persist.
- }
-
- if ( sb.length() > 0 )
- sb.insert( 0, " where " );
- sb.insert( 0, "select project from Project as project " );
-
- return sb.toString();
- }
-
-}
diff --git a/src/main/java/org/apache/continuum/store/jpa/ProjectQuery.java b/src/main/java/org/apache/continuum/store/jpa/ProjectQuery.java
deleted file mode 100644
index cc744ba..0000000
--- a/src/main/java/org/apache/continuum/store/jpa/ProjectQuery.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.jpa;
-
-import java.util.Date;
-import java.util.Map;
-
-import org.apache.continuum.store.api.Query;
-
-/**
- * Wraps up retrieval criteria for {@link Project}s.
- *
- * @author <a href='mailto:rinku@apache.org'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public class ProjectQuery<Project> implements Query<Project>
-{
-
- /**
- * Project artifactId criteria.
- */
- private String artifactId;
-
- /**
- * Project groupId criteria.
- */
- private String groupId;
-
- /**
- * Project id criteria.
- */
- private Long id;
-
- /**
- * Project name criteria.
- */
- private String name;
-
- /**
- * Project Artifact version criteria.
- */
- private String version;
-
- private int buildNumber;
-
- private Date dateCreated;
-
- private Date dateUpdated;
-
- private String description;
-
- private String modelEncoding;
-
- /**
- * @return the artifactId
- */
- public String getArtifactId()
- {
- return this.artifactId;
- }
-
- /**
- * @return build number as query critera
- */
- public int getBuildNumber()
- {
- return this.buildNumber;
- }
-
- /**
- * Determines if a build number criteria was specified in the Project query.
- *
- * @return
- */
- public boolean hasBuildNumber()
- {
- return ( this.buildNumber > 0 );
- }
-
- /**
- * @return creation date as query criteria
- */
- public Date getDateCreated()
- {
- return this.dateCreated;
- }
-
- /**
- * Determines if there was a creation date criteria specified in the ProjectQuery.
- *
- * @return <code>true</code> if a creation date was specified, else <code>false</code>.
- */
- public boolean hasDateCreated()
- {
- return ( null != this.dateCreated );
- }
-
- /**
- * @return last update date from query criteria.
- */
- public Date getDateUpdated()
- {
- return this.dateUpdated;
- }
-
- /**
- * Determine if there was a last update date criteria specified in the ProjectQuery.
- *
- * @return <code>true</code> if there was a last update date criteria specified, else <code>false</code>.
- */
- public boolean hasDateUpdated()
- {
- return ( null != this.dateUpdated );
- }
-
- /**
- * @return description criteria from the query.
- */
- public String getDescription()
- {
- return this.description;
- }
-
- /**
- * Determines if there was description criteria specified in the ProjectQuery.
- *
- * @return <code>true</code> if there was description criteria specified, else <code>false</code>.
- */
- public boolean hasDescription()
- {
- return ( null != this.description && this.description.length() > 0 );
- }
-
- /**
- * @return the groupId
- */
- public String getGroupId()
- {
- return this.groupId;
- }
-
- /**
- * @return the id
- */
- public Long getId()
- {
- return this.id;
- }
-
- /**
- * @return model encoding criteria from the query.
- */
- public String getModelEncoding()
- {
- return this.modelEncoding;
- }
-
- /**
- * Determine if there is a model encoding specified in the ProjectQuery.
- *
- * @return <code>true</code> if there is a model encoding specified, else <code>false</code>.
- */
- public boolean hasModelEncoding()
- {
- return ( null != this.modelEncoding && this.modelEncoding.length() > 0 );
- }
-
- /**
- * @return the name
- */
- public String getName()
- {
- return this.name;
- }
-
- /**
- * @return the version
- */
- public String getVersion()
- {
- return this.version;
- }
-
- /**
- * Determines if an artifact Id criteria was specified.
- *
- * @return
- */
- public boolean hasArtifactId()
- {
- return ( null != this.artifactId );
- }
-
- /**
- * Determines if a ProjectGroup Id criteria was specified.
- *
- * @return
- */
- public boolean hasGroupId()
- {
- return ( null != this.groupId );
- }
-
- /**
- * Determines if a Project id criteria was specified in the query.
- *
- * @return
- */
- public boolean hasId()
- {
- return ( null != this.id && this.id >= 0 );
- }
-
- /**
- * Determines if a project name criteria was specified.
- *
- * @return
- */
- public boolean hasName()
- {
- return ( null != this.name );
- }
-
- /**
- * Determines if a Version criteria was specified.
- *
- * @return
- */
- public boolean hasVersion()
- {
- return ( null != this.version );
- }
-
- /**
- * @param artifactId
- * the artifactId to set
- */
- public void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- /**
- * @param buildNumber
- * criteria to set in the ProjectQuery
- */
- public void setBuildNumber( int buildNumber )
- {
- this.buildNumber = buildNumber;
- }
-
- /**
- * @param created
- * criteria to set in the Project Query.
- */
- public void setDateCreated( Date dateCreated )
- {
- this.dateCreated = dateCreated;
- }
-
- /**
- * @param updated
- * date criteria to set in the Project Query.
- */
- public void setDateUpdated( Date dateUpdated )
- {
- this.dateUpdated = dateUpdated;
- }
-
- /**
- * @param description
- */
- public void setDescription( String description )
- {
- this.description = description;
- }
-
- /**
- * @param groupId
- * the groupId to set
- */
- public void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- /**
- * @param id
- * the id to set
- */
- public void setId( Long id )
- {
- this.id = id;
- }
-
- /**
- * @param name
- * the name to set
- */
- public void setName( String name )
- {
- this.name = name;
- }
-
- /**
- * @param version
- * the version to set
- */
- public void setVersion( String version )
- {
- this.version = version;
- }
-
- /**
- * @{inheritDoc}
- *
- * @see org.apache.continuum.store.api.Query#toString(java.util.Map)
- */
- public String toString( Map<String, Object> whereClause )
- {
- StringBuffer sb = new StringBuffer();
-
- if ( this.hasId() )
- {
- whereClause.put( "id", this.getId() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.id =:id " );
- }
- if ( this.hasDateCreated() )
- {
- whereClause.put( "dateCreated", this.getDateCreated() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.dateCreated =:dateCreated " );
- }
- if ( this.hasDateUpdated() )
- {
- whereClause.put( "dateUpdated", this.getDateUpdated() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.dateUpdated =:dateUpdated " );
- }
- if ( this.hasDescription() )
- {
- whereClause.put( "description", this.getDescription() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.description =:description " );
- }
- if ( this.hasGroupId() )
- {
- whereClause.put( "groupId", this.getGroupId() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.groupId =:groupId " );
- }
- if ( this.hasModelEncoding() )
- {
- whereClause.put( "modelEncoding", this.getModelEncoding() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.modelEncoding =:modelEncoding " );
- }
- if ( this.hasName() )
- {
- whereClause.put( "name", this.getName() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.name =:name " );
- }
- if ( this.hasArtifactId() )
- {
- whereClause.put( "artifactId", this.getArtifactId() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.artifactId =:artifactId" );
- }
- if ( this.hasBuildNumber() )
- {
- whereClause.put( "buildNumber", this.getBuildNumber() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.buildNumber =:buildNumber" );
- }
- if ( this.hasVersion() )
- {
- whereClause.put( "version", this.getVersion() );
- if ( sb.length() > 0 )
- sb.append( "and" );
- sb.append( " project.version =:version" );
- }
-
- if ( sb.length() > 0 )
- sb.insert( 0, " where " );
- sb.insert( 0, "select project from Project as project " );
-
- return sb.toString();
- }
-
-}
diff --git a/src/main/java/org/apache/continuum/store/jpa/StoreSupport.java b/src/main/java/org/apache/continuum/store/jpa/StoreSupport.java
deleted file mode 100644
index 15e5e1e..0000000
--- a/src/main/java/org/apache/continuum/store/jpa/StoreSupport.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.store.jpa;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceException;
-import javax.persistence.Query;
-
-import org.apache.continuum.store.api.Store;
-import org.springframework.dao.DataAccessException;
-import org.springframework.orm.jpa.JpaCallback;
-import org.springframework.orm.jpa.support.JpaDaoSupport;
-
-/**
- * Base class for concrete {@link Store} implementations that provides service methods for Entity retrievals.
- *
- * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
- * @version $Id$
- * @since 1.2
- */
-public abstract class StoreSupport extends JpaDaoSupport
-{
-
- /**
- * Prepares and executes a query using the 'where' criteria, a start index and a given range of results to return.
- *
- * @param queryString
- * @param whereParams
- * @param startIndex
- * @param range
- * @return
- * @throws DataAccessException
- */
- protected List find( final String queryString, final Map<String, Object> whereParams, final int startIndex,
- final int range ) throws DataAccessException
- {
- return getJpaTemplate().executeFind( new JpaCallback()
- {
- public Object doInJpa( EntityManager em ) throws PersistenceException
- {
- Query query = em.createQuery( queryString );
- if ( whereParams != null )
- {
- for ( Iterator it = whereParams.entrySet().iterator(); it.hasNext(); )
- {
- Map.Entry<String, Object> entry = (Map.Entry<String, Object>) it.next();
- query.setParameter( entry.getKey(), entry.getValue() );
- }
- }
- if ( startIndex > 0 )
- {
- query.setFirstResult( startIndex );
- }
- if ( range > 0 )
- {
- query.setMaxResults( range );
- }
- return query.getResultList();
- }
- } );
- }
-
-}
diff --git a/src/test/resources/META-INF/spring-config.xml b/src/test/resources/META-INF/spring-config.xml
index 8e52903..56e4864 100644
--- a/src/test/resources/META-INF/spring-config.xml
+++ b/src/test/resources/META-INF/spring-config.xml
@@ -31,32 +31,6 @@
<!-- enable the configuration of transactional behavior based on annotations -->
<tx:annotation-driven transaction-manager="transactionManager" />
- <bean id="storeFactory"
- class="org.apache.continuum.store.jpa.JpaStoreFactory">
- </bean>
-
- <bean id="projectStore"
- class="org.apache.continuum.store.jpa.JpaStore"
- factory-bean="storeFactory"
- factory-method="createProjectStoreInstance">
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- </bean>
-
- <bean id="projectGroupStore"
- class="org.apache.continuum.store.jpa.JpaStore"
- factory-bean="storeFactory"
- factory-method="createProjectGroupStoreInstance">
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- </bean>
-
- <bean id="projectNotifierStore"
- class="org.apache.continuum.store.jpa.JpaStore"
- factory-bean="storeFactory"
- factory-method="createProjectNotifierStoreInstance">
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- </bean>
-
-
<!-- DAO -->
<bean id="daoFactory"
@@ -98,4 +72,4 @@
<property name="notifierDao" ref="notifierDao"/>
</bean>
-</beans>
\ No newline at end of file
+</beans>