01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.sail.rdbms.model;
07:
08: import org.openrdf.model.Value;
09:
10: /**
11: * Provides an internal id and version for values.
12: *
13: * @author James Leigh
14: *
15: */
16: public abstract class RdbmsValue implements Value {
17: private transient Number id;
18: private transient Integer version;
19:
20: public RdbmsValue() {
21: }
22:
23: public RdbmsValue(Number id, Integer version) {
24: this .id = id;
25: this .version = version;
26: }
27:
28: public Number getInternalId() {
29: return id;
30: }
31:
32: public void setInternalId(Number id) {
33: this .id = id;
34: }
35:
36: public Integer getVersion() {
37: return version;
38: }
39:
40: public void setVersion(Integer version) {
41: this .version = version;
42: }
43:
44: public boolean isExpired(int v) {
45: if (id == null)
46: return true;
47: if (version == null)
48: return true;
49: return version.intValue() != v;
50: }
51: }
|