## com.imcode.imcms.mapping
Class CategoryMapper

    java.lang.Object
      com.imcode.imcms.mapping.CategoryMapper

    public class CategoryMapper

extends java.lang.Object

Field Summary
`static java.lang.String` `SQL__CATEGORY_TYPE__COLUMNS`
`static java.lang.String` `SQL__GET_CATEGORY_BY_NAME_AND_CATEGORY_TYPE_ID`
`static java.lang.String` `SQL_GET_ALL_CATEGORIES_OF_TYPE`

Constructor Summary
`CategoryMapper(com.imcode.db.Database database)`

Method Summary
`CategoryDomainObject` `addCategory(CategoryDomainObject category)`
`CategoryTypeDomainObject` `addCategoryTypeToDb(CategoryTypeDomainObject categoryType)`
`void` `deleteCategoryFromDb(CategoryDomainObject category)`
`void` `deleteCategoryTypeFromDb(CategoryTypeDomainObject categoryType)`
`void` `deleteOneCategoryFromDocument(DocumentDomainObject document, CategoryDomainObject category)`
`CategoryDomainObject[]` `getAllCategoriesOfType(CategoryTypeDomainObject categoryType)`
`CategoryTypeDomainObject[]` `getAllCategoryTypes()`
`java.lang.String[]` `getAllDocumentsOfOneCategory(CategoryDomainObject category)`
`java.util.Set` `getCategories(java.util.Collection categoryIds)`
`java.util.Set` `getCategoriesOfType(CategoryTypeDomainObject categoryType, java.util.Set categoryIds)`
`CategoryDomainObject` `getCategoryById(int categoryId)`
`CategoryDomainObject` `getCategoryByTypeAndName(CategoryTypeDomainObject categoryType, java.lang.String categoryName)`
`CategoryTypeDomainObject` `getCategoryTypeById(int categoryTypeId)`
`CategoryTypeDomainObject` `getCategoryTypeByName(java.lang.String categoryTypeName)`
`boolean` `isUniqueCategoryTypeName(java.lang.String categoryTypeName)`
`void` `saveCategory(CategoryDomainObject category)`
`void` `updateCategory(CategoryDomainObject category)`
`void` `updateCategoryType(CategoryTypeDomainObject categoryType)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SQL__CATEGORY_TYPE__COLUMNS

    public static final java.lang.String SQL__CATEGORY_TYPE__COLUMNS

See Also:
  Constant Field Values

### SQL_GET_ALL_CATEGORIES_OF_TYPE

    public static final java.lang.String SQL_GET_ALL_CATEGORIES_OF_TYPE

See Also:
  Constant Field Values

### SQL__GET_CATEGORY_BY_NAME_AND_CATEGORY_TYPE_ID

    public static final java.lang.String SQL__GET_CATEGORY_BY_NAME_AND_CATEGORY_TYPE_ID

See Also:
  Constant Field Values

Constructor Detail

### CategoryMapper

    public CategoryMapper(com.imcode.db.Database database)

Method Detail

### getAllCategoriesOfType

    public CategoryDomainObject[] getAllCategoriesOfType(CategoryTypeDomainObject categoryType)

### isUniqueCategoryTypeName

    public boolean isUniqueCategoryTypeName(java.lang.String categoryTypeName)

### getAllCategoryTypes

    public CategoryTypeDomainObject[] getAllCategoryTypes()

### getCategoryByTypeAndName

    public CategoryDomainObject getCategoryByTypeAndName(CategoryTypeDomainObject categoryType,
                                                         java.lang.String categoryName)

### getCategoryById

    public CategoryDomainObject getCategoryById(int categoryId)

### getCategoryTypeByName

    public CategoryTypeDomainObject getCategoryTypeByName(java.lang.String categoryTypeName)

### getCategoryTypeById

    public CategoryTypeDomainObject getCategoryTypeById(int categoryTypeId)

### deleteCategoryTypeFromDb

    public void deleteCategoryTypeFromDb(CategoryTypeDomainObject categoryType)

### addCategoryTypeToDb

    public CategoryTypeDomainObject addCategoryTypeToDb(CategoryTypeDomainObject categoryType)

### updateCategoryType

    public void updateCategoryType(CategoryTypeDomainObject categoryType)

### addCategory

    public CategoryDomainObject addCategory(CategoryDomainObject category)
                                     throws CategoryAlreadyExistsException

  Throws:
    `CategoryAlreadyExistsException`

### updateCategory

    public void updateCategory(CategoryDomainObject category)

### deleteCategoryFromDb

    public void deleteCategoryFromDb(CategoryDomainObject category)

### getAllDocumentsOfOneCategory

    public java.lang.String[] getAllDocumentsOfOneCategory(CategoryDomainObject category)

### deleteOneCategoryFromDocument

    public void deleteOneCategoryFromDocument(DocumentDomainObject document,
                                              CategoryDomainObject category)

### saveCategory

    public void saveCategory(CategoryDomainObject category)
                      throws CategoryAlreadyExistsException

  Throws:
    `CategoryAlreadyExistsException`

### getCategories

    public java.util.Set getCategories(java.util.Collection categoryIds)

### getCategoriesOfType

    public java.util.Set getCategoriesOfType(CategoryTypeDomainObject categoryType,
                                             java.util.Set categoryIds)