📄 forest.java
字号:
//$Id: Forest.java 11282 2007-03-14 22:05:59Z epbernard $package org.hibernate.test.annotations.entity;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;import javax.persistence.Lob;import org.hibernate.annotations.BatchSize;import org.hibernate.annotations.Filter;import org.hibernate.annotations.FilterDef;import org.hibernate.annotations.Filters;import org.hibernate.annotations.Index;import org.hibernate.annotations.OptimisticLockType;import org.hibernate.annotations.ParamDef;import org.hibernate.annotations.Parameter;import org.hibernate.annotations.PolymorphismType;import org.hibernate.annotations.Type;import org.hibernate.annotations.Where;/** * Use hibernate specific annotations * * @author Emmanuel Bernard */@Entity@BatchSize(size = 5)@org.hibernate.annotations.Entity( selectBeforeUpdate = true, dynamicInsert = true, dynamicUpdate = true, optimisticLock = OptimisticLockType.ALL, polymorphism = PolymorphismType.EXPLICIT)@Where(clause = "1=1")@FilterDef(name = "minLength", parameters = {@ParamDef(name = "minLength", type = "integer")})@Filters({@Filter(name = "betweenLength"),@Filter(name = "minLength", condition = ":minLength <= length") })@org.hibernate.annotations.Table(appliesTo = "Forest", indexes = {@Index(name = "idx", columnNames = {"name", "length"})})public class Forest { private Integer id; private String name; private long length; private String longDescription; private String smallText; private String bigText; private Country country; @Type(type = "text") public String getLongDescription() { return longDescription; } public void setLongDescription(String longDescription) { this.longDescription = longDescription; } public long getLength() { return length; } public void setLength(long length) { this.length = length; } @Id @GeneratedValue public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Type(type = "caster") public String getSmallText() { return smallText; } @Type(type = "caster", parameters = {@Parameter(name = "cast", value = "upper")}) public String getBigText() { return bigText; } public void setSmallText(String smallText) { this.smallText = smallText; } public void setBigText(String bigText) { this.bigText = bigText; } @Lob public Country getCountry() { return country; } public void setCountry(Country country) { this.country = country; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -