
test.googlecode.genericdao.model.LimbedPet Maven / Gradle / Ivy
/* Copyright 2009 The Revere Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.googlecode.genericdao.model;
import java.util.List;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinTable;
import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.IndexColumn;
@Entity
@DiscriminatorValue("1")
public class LimbedPet extends Pet {
private List limbs;
private boolean hasPaws;
@CollectionOfElements
@JoinTable
@IndexColumn(name = "idx")
public List getLimbs() {
return limbs;
}
public void setLimbs(List limbs) {
this.limbs = limbs;
}
public boolean isHasPaws() {
return hasPaws;
}
public void setHasPaws(boolean hasPaws) {
this.hasPaws = hasPaws;
}
public String toString() {
StringBuilder sb = new StringBuilder();
if (limbs == null) {
sb.append("null");
} else {
sb.append("[");
for (String limb : limbs) {
sb.append(limb);
}
sb.append("]");
}
return "LimbedPet::super:{" + super.toString() + "},hasPaws:" + hasPaws + ",limbs:" + sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy