org.jtheque.movies.services.impl
Class CategoriesService

java.lang.Object
  extended by org.jtheque.movies.services.impl.CategoriesService
All Implemented Interfaces:
org.jtheque.core.managers.persistence.able.DataContainer<Category>, ICategoriesService, org.jtheque.primary.services.able.DataService<Category>

public final class CategoriesService
extends Object
implements ICategoriesService

A categories service implementation.

Author:
Baptiste Wicht

Field Summary
 
Fields inherited from interface org.jtheque.movies.services.able.ICategoriesService
DATA_TYPE
 
Constructor Summary
CategoriesService()
           
 
Method Summary
 void addDataListener(org.jtheque.core.managers.persistence.able.DataListener listener)
           
 void clearAll()
           
 void create(Category category)
           
 boolean delete(Category category)
           
 boolean exists(String category)
          Test if a category exists or not.
 boolean existsInOtherCategory(String title, Category category)
          Test if the specified title exists in the other categories.
 Collection<Category> getCategories()
          Return the categories of the current collection.
 Category getCategory(String name)
          Return the category of the specified name.
 Collection<Category> getDatas()
           
 String getDataType()
           
 Category getEmptyCategory()
          Return an empty category.
 Collection<Category> getSubCategories(Category category)
          Return all the sub categories of the specified category.
 void save(Category category)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoriesService

public CategoriesService()
Method Detail

getCategories

public Collection<Category> getCategories()
Description copied from interface: ICategoriesService
Return the categories of the current collection.

Specified by:
getCategories in interface ICategoriesService
Returns:
A List containing the categories of the current collection.

delete

@Transactional
public boolean delete(Category category)
Specified by:
delete in interface org.jtheque.primary.services.able.DataService<Category>

create

@Transactional
public void create(Category category)
Specified by:
create in interface org.jtheque.primary.services.able.DataService<Category>

save

@Transactional
public void save(Category category)
Specified by:
save in interface org.jtheque.primary.services.able.DataService<Category>

exists

public boolean exists(String category)
Description copied from interface: ICategoriesService
Test if a category exists or not.

Specified by:
exists in interface ICategoriesService
Parameters:
category - The category to test.
Returns:
true if the category exists else false.

getCategory

public Category getCategory(String name)
Description copied from interface: ICategoriesService
Return the category of the specified name.

Specified by:
getCategory in interface ICategoriesService
Parameters:
name - The name of the category.
Returns:
The category.

getEmptyCategory

public Category getEmptyCategory()
Description copied from interface: ICategoriesService
Return an empty category.

Specified by:
getEmptyCategory in interface ICategoriesService
Returns:
An empty category.

existsInOtherCategory

public boolean existsInOtherCategory(String title,
                                     Category category)
Description copied from interface: ICategoriesService
Test if the specified title exists in the other categories.

Specified by:
existsInOtherCategory in interface ICategoriesService
Parameters:
title - The title to search for.
category - The category to exclude from search.
Returns:
true if this title exists in other category else false.

getSubCategories

public Collection<Category> getSubCategories(Category category)
Description copied from interface: ICategoriesService
Return all the sub categories of the specified category.

Specified by:
getSubCategories in interface ICategoriesService
Parameters:
category - The categories to get the child for.
Returns:
A Collection containing all the sub categories of the specified category.

getDatas

public Collection<Category> getDatas()
Specified by:
getDatas in interface org.jtheque.core.managers.persistence.able.DataContainer<Category>

addDataListener

public void addDataListener(org.jtheque.core.managers.persistence.able.DataListener listener)
Specified by:
addDataListener in interface org.jtheque.core.managers.persistence.able.DataContainer<Category>

getDataType

public String getDataType()
Specified by:
getDataType in interface org.jtheque.core.managers.persistence.able.DataContainer<Category>

clearAll

@Transactional
public void clearAll()
Specified by:
clearAll in interface org.jtheque.core.managers.persistence.able.DataContainer<Category>


Copyright © 2010 JTheque. All Rights Reserved.