summaryrefslogtreecommitdiff
path: root/examples/java/src/persist/gettingStarted/SimpleEntityClass.java
diff options
context:
space:
mode:
authorLorry <lorry@roadtrain.codethink.co.uk>2012-07-20 20:00:05 +0100
committerLorry <lorry@roadtrain.codethink.co.uk>2012-07-20 20:00:05 +0100
commit3ef782d3745ea8f25a3151561a3cfb882190210e (patch)
tree86b9c2f5fde051dd0bced99b3fc9f5a3ba08db69 /examples/java/src/persist/gettingStarted/SimpleEntityClass.java
downloadberkeleydb-3ef782d3745ea8f25a3151561a3cfb882190210e.tar.gz
Tarball conversion
Diffstat (limited to 'examples/java/src/persist/gettingStarted/SimpleEntityClass.java')
-rw-r--r--examples/java/src/persist/gettingStarted/SimpleEntityClass.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/java/src/persist/gettingStarted/SimpleEntityClass.java b/examples/java/src/persist/gettingStarted/SimpleEntityClass.java
new file mode 100644
index 00000000..1ec16b22
--- /dev/null
+++ b/examples/java/src/persist/gettingStarted/SimpleEntityClass.java
@@ -0,0 +1,42 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2008, 2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * $Id$
+ */
+
+package persist.gettingStarted;
+
+import com.sleepycat.persist.model.Entity;
+import com.sleepycat.persist.model.PrimaryKey;
+import static com.sleepycat.persist.model.Relationship.*;
+import com.sleepycat.persist.model.SecondaryKey;
+
+@Entity
+public class SimpleEntityClass {
+
+ // Primary key is pKey
+ @PrimaryKey
+ private String pKey;
+
+ // Secondary key is the sKey
+ @SecondaryKey(relate=MANY_TO_ONE)
+ private String sKey;
+
+ public void setpKey(String data) {
+ pKey = data;
+ }
+
+ public void setsKey(String data) {
+ sKey = data;
+ }
+
+ public String getpKey() {
+ return pKey;
+ }
+
+ public String getsKey() {
+ return sKey;
+ }
+}