Skip to main content
summaryrefslogtreecommitdiffstats
blob: 83dd202b358063afba5f179344b22b0603775377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*******************************************************************************
 * Copyright (c) 2008 Oracle. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0, which accompanies this distribution
 * and is available at http://www.eclipse.org/legal/epl-v10.html.
 *
 * Contributors:
 *     Oracle - initial API and implementation
 ******************************************************************************/
package org.eclipse.jpt.eclipselink.ui.internal.caching;

import org.eclipse.jpt.eclipselink.core.internal.context.caching.CacheType;
import org.eclipse.jpt.eclipselink.core.internal.context.caching.Caching;
import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.jpt.utility.internal.model.AbstractModel;

/**
 * EntityCacheProperties
 */
public class EntityCacheProperties extends AbstractModel {

	private Caching caching;
	private String entityName;

	// ********** constructors **********
	public EntityCacheProperties(Caching caching, String entityName) {
		super();
		this.caching    = caching;
		this.entityName = entityName;
	}

	public boolean entityNameIsValid() {
		return !StringTools.stringIsEmpty(this.entityName);
	}

	public Integer getCacheSize() {
		return this.caching.getCacheSize(this.entityName);
	}

	public CacheType getCacheType() {
		return this.caching.getCacheType(this.entityName);
	}

	public CacheType getDefaultCacheType() {
		return this.caching.getDefaultCacheType();
	}

	public String getEntityName() {
		return this.entityName;
	}

	public Boolean getSharedCache() {
		return this.caching.getSharedCache(this.entityName);
	}

	public Boolean getSharedCacheDefault() {
		return this.caching.getDefaultSharedCache();
	}

	public void setCacheSize(Integer cachingSize) {
		this.caching.setCacheSize(cachingSize, this.entityName);
	}

	public void setCacheType(CacheType cacheType) {
		this.caching.setCacheType(cacheType, this.entityName);
	}

	public void setSharedCache(Boolean sharedCache) {
		this.caching.setSharedCache(sharedCache, this.entityName);
	}
}

Back to the top