diff options
Diffstat (limited to 'examples/java/src/persist/gettingStarted/SimpleEntityClass.java')
| -rw-r--r-- | examples/java/src/persist/gettingStarted/SimpleEntityClass.java | 42 |
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; + } +} |
