PageRenderTime 26ms CodeModel.GetById 19ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://thoughtsite.googlecode.com/
Java | 134 lines | 69 code | 20 blank | 45 comment | 0 complexity | 583d996b29402b5b82e2408788d6f746 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 org.compass.annotations.Searchable;
 19import org.compass.annotations.SearchableId;
 20import org.compass.annotations.SearchableProperty;
 21
 22import java.io.Serializable;
 23import java.util.Date;
 24
 25import javax.jdo.annotations.Extension;
 26import javax.jdo.annotations.IdGeneratorStrategy;
 27import javax.jdo.annotations.IdentityType;
 28import javax.jdo.annotations.PersistenceCapable;
 29import javax.jdo.annotations.Persistent;
 30import javax.jdo.annotations.PrimaryKey;
 31
 32@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
 33@Searchable(alias = "Tag")
 34public class Tag implements Serializable, Comparable<Tag> {
 35
 36    /** A unique identifier for the class */
 37    private static final long serialVersionUID = 6800326271810454423L;
 38    public static final String FIELD_WEIGHTAGE = "weightage";
 39    @PrimaryKey
 40    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 41    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
 42    @SearchableId
 43    private String key;
 44    @Persistent
 45    @SearchableProperty
 46    private String title;
 47    @Persistent
 48    @SearchableProperty
 49    private int weightage;
 50    @Persistent
 51    private Date createdOn;
 52    @Persistent
 53    private Date updatedOn;
 54
 55    public Tag() {
 56
 57    }
 58
 59    /**
 60     * @return the title
 61     */
 62    public String getTitle() {
 63        return title;
 64    }
 65
 66    /**
 67     * @param title the title to set
 68     */
 69    public void setTitle(String title) {
 70        this.title = title;
 71    }
 72
 73    /**
 74     * @return the weightage
 75     */
 76    public int getWeightage() {
 77        return weightage;
 78    }
 79
 80    /**
 81     * @param weightage the weightage to set
 82     */
 83    public void setWeightage(int weightage) {
 84        this.weightage = weightage;
 85    }
 86
 87    /**
 88     * @return the createdOn
 89     */
 90    public Date getCreatedOn() {
 91        return createdOn;
 92    }
 93
 94    /**
 95     * @param createdOn the createdOn to set
 96     */
 97    public void setCreatedOn(Date createdOn) {
 98        this.createdOn = createdOn;
 99    }
100
101    /**
102     * @return the updatedOn
103     */
104    public Date getUpdatedOn() {
105        return updatedOn;
106    }
107
108    /**
109     * @param updatedOn the updatedOn to set
110     */
111    public void setUpdatedOn(Date updatedOn) {
112        this.updatedOn = updatedOn;
113    }
114
115    /**
116     * @param key the key to set
117     */
118    public void setKey(String key) {
119        this.key = key;
120    }
121
122    /**
123     * @return the key
124     */
125    public String getKey() {
126        return key;
127    }
128
129    @Override
130    public int compareTo(Tag o) {
131        return this.weightage - o.weightage;
132    }
133}
134