added polytomous key tests and initial developments on caching
[taxeditor.git] / eu.etaxonomy.taxeditor.remoting / src / main / java / eu / etaxonomy / cdm / api / cache / ICachedCommonService.java
1 // $Id$
2 /**
3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.api.cache;
11
12 import org.hibernate.collection.internal.PersistentMap;
13 import org.hibernate.collection.spi.PersistentCollection;
14
15 import eu.etaxonomy.cdm.api.cache.CachedCommonServiceImpl.CollectionField;
16 import eu.etaxonomy.cdm.model.common.CdmBase;
17
18 /**
19 * @author cmathew
20 * @date 14 Oct 2014
21 *
22 */
23 public interface ICachedCommonService {
24
25 public CdmBase find(Class<? extends CdmBase> clazz, int id);
26
27 public PersistentCollection initializeCollection(PersistentCollection col);
28
29 public void updatePersistentCollection(CollectionField colf);
30
31 public boolean isEmpty(PersistentCollection col);
32
33 public int size(PersistentCollection col);
34
35 public Object get(PersistentCollection col, int index);
36
37 public boolean contains(PersistentCollection col, Object element);
38
39 public boolean containsKey(PersistentCollection col, Object key);
40
41 public boolean containsValue(PersistentCollection col, Object element);
42
43 public CollectionField getCollectionField(PersistentCollection pc);
44
45 }