PageRenderTime 419ms CodeModel.GetById 242ms app.highlight 16ms RepoModel.GetById 156ms app.codeStats 0ms

/src/main/java/com/google/ie/business/domain/EntityIndex.java

http://thoughtsite.googlecode.com/
Java | 80 lines | 43 code | 17 blank | 20 comment | 0 complexity | 3ffdc050856f75b2746bed36cf624cd2 MD5 | raw file
 1/* Copyright 2010 Google Inc.
 2 * 
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 * 
 7 *      http://www.apache.org/licenses/LICENSE-2.0
 8 * 
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS.
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
14 */
15
16package com.google.ie.business.domain;
17
18import com.google.appengine.api.datastore.Key;
19import com.google.appengine.api.datastore.KeyFactory;
20
21import javax.jdo.annotations.Extension;
22import javax.jdo.annotations.IdGeneratorStrategy;
23import javax.jdo.annotations.IdentityType;
24import javax.jdo.annotations.PersistenceCapable;
25import javax.jdo.annotations.Persistent;
26import javax.jdo.annotations.PrimaryKey;
27
28@PersistenceCapable(identityType = IdentityType.APPLICATION)
29public class EntityIndex {
30
31    @PrimaryKey
32    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
33    private Key key;
34
35    @Persistent
36    private int indexed;
37
38    @Persistent
39    @Extension(vendorName = "datanucleus", key = "gae.parent-pk", value = "true")
40    private Key parentKey;
41
42    /**
43     * Construct ideaIndexStatus entity whose parent idea identified by
44     * ideaKey
45     * 
46     * @param ideaKey
47     */
48    public EntityIndex(String parentKey) {
49        this.parentKey = KeyFactory.stringToKey(parentKey);
50    }
51
52    public EntityIndex() {
53
54    }
55
56    public int getIndexed() {
57        return indexed;
58    }
59
60    public void setIndexed(int indexed) {
61        this.indexed = indexed;
62    }
63
64    public Key getKey() {
65        return key;
66    }
67
68    public void setKey(Key key) {
69        this.key = key;
70    }
71
72    public Key getParentKey() {
73        return parentKey;
74    }
75
76    public void setParentKey(Key parentKey) {
77        this.parentKey = parentKey;
78    }
79}
80