com.rapidtransform.core.service.impl
Class MetaCRUDServiceImpl<Type extends Model>

java.lang.Object
  extended by com.rapidtransform.core.service.impl.ServiceImpl
      extended by com.rapidtransform.core.service.impl.CRUDServiceImpl<Type>
          extended by com.rapidtransform.core.service.impl.MetaCRUDServiceImpl<Type>
All Implemented Interfaces:
CRUDService<Type>, MetaCRUDService<Type>, Service
Direct Known Subclasses:
DocumentServiceImpl, ItemServiceImpl, ProductServiceImpl, SpecServiceImpl

public abstract class MetaCRUDServiceImpl<Type extends Model>
extends CRUDServiceImpl<Type>
implements MetaCRUDService<Type>

Service abstraction for M1 classes that implement the Model interface - ie. those containing meta information.

Author:
Steve Werner

Constructor Summary
MetaCRUDServiceImpl()
           
MetaCRUDServiceImpl(java.lang.Class<Type> persistentClass)
           
 
Method Summary
 Type create(QName qname)
          Creates an M1 object with the given Meta type specified by the QName.
 Relation createRelation(Type source, Model target, QName relationType)
          Creates a relation with the given type between the source and target models.
 java.util.List<Type> findByMetaType(java.lang.String metaTypeQName)
          Returns all instances with the given metaType.
 MetaService getMetaService()
           
 RelationDAO getRelationDao()
           
 void setMetaService(MetaService metaService)
           
 void setRelationDao(RelationDAO relationDao)
           
 
Methods inherited from class com.rapidtransform.core.service.impl.CRUDServiceImpl
create, find, findAll, getDao, getLog, getPersistentClass, save, setDao, setPersistentClass
 
Methods inherited from class com.rapidtransform.core.service.impl.ServiceImpl
getMessageSource, getSecurityService, setMessageSource, setSecurityService
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rapidtransform.core.service.CRUDService
create, find, findAll, save
 

Constructor Detail

MetaCRUDServiceImpl

public MetaCRUDServiceImpl()

MetaCRUDServiceImpl

public MetaCRUDServiceImpl(java.lang.Class<Type> persistentClass)
Method Detail

getMetaService

public MetaService getMetaService()
Returns:
Returns the metaService.

setMetaService

public void setMetaService(MetaService metaService)
Parameters:
metaService - The metaService to set.

getRelationDao

public RelationDAO getRelationDao()
Returns:
Returns the relationDao.

setRelationDao

public void setRelationDao(RelationDAO relationDao)
Parameters:
relationDao - The relationDao to set.

create

public Type create(QName qname)
                          throws MetaException
Description copied from interface: MetaCRUDService
Creates an M1 object with the given Meta type specified by the QName.

Specified by:
create in interface MetaCRUDService<Type extends Model>
Returns:
Model entity with it's meta attributes initialized
Throws:
MetaException

createRelation

@Transactional
public Relation createRelation(Type source,
                                             Model target,
                                             QName relationType)
                        throws ConveloException,
                               InvalidMetaRelationException
Creates a relation with the given type between the source and target models. If the relation is not defined in the Meta mapping for the source, then an InvalidMetaRelationException is thrown. After the relation is created it is saved to the database and returned.

Specified by:
createRelation in interface MetaCRUDService<Type extends Model>
Parameters:
source -
target -
relationType -
Returns:
Throws:
ConveloException
InvalidMetaRelationException

findByMetaType

public java.util.List<Type> findByMetaType(java.lang.String metaTypeQName)
Description copied from interface: MetaCRUDService
Returns all instances with the given metaType.

Specified by:
findByMetaType in interface MetaCRUDService<Type extends Model>
Returns: