package com.longge.vo;
/**
* Productview generated by MyEclipse Persistence Tools
*/
public class Productview implements java.io.Serializable {
// Fields
private ProductviewId id;
// Constructors
/** default constructor */
public Productview() {
}
/** full constructor */
public Productview(ProductviewId id) {
this.id = id;
}
// Property accessors
public ProductviewId getId() {
return this.id;
}
public void setId(ProductviewId id) {
this.id = id;
}
}
package com.longge.vo;
import java.util.Date;
/**
* ProductviewId generated by MyEclipse Persistence Tools
*/
public class ProductviewId implements java.io.Serializable {
// Fields
private Integer id;
private String username;
private Integer genre;
private String name;
private String title;
private Integer category;
private Integer validity;
private String unit;
private String price;
private String revise;
private String gross;
private String deadline;
private String explain;
private String imgurl;
private Integer condition;
private Date times;
private Integer retainday;
private String report;
private Integer state;
// Constructors
/** default constructor */
public ProductviewId() {
}
/** minimal constructor */
public ProductviewId(Integer id, String username, Integer genre,
String name, String title, Integer category) {
this.id = id;
this.username = username;
this.genre = genre;
this.name = name;
this.title = title;
this.category = category;
}
/** full constructor */
public ProductviewId(Integer id, String username, Integer genre,
String name, String title, Integer category, Integer validity,
String unit, String price, String revise, String gross,
String deadline, String explain, String imgurl, Integer condition,
Date times, Integer retainday, String report, Integer state) {
this.id = id;
this.username = username;
this.genre = genre;
this.name = name;
this.title = title;
this.category = category;
this.validity = validity;
this.unit = unit;
this.price = price;
this.revise = revise;
this.gross = gross;
this.deadline = deadline;
this.explain = explain;
this.imgurl = imgurl;
this.condition = condition;
this.times = times;
this.retainday = retainday;
this.report = report;
this.state = state;
}
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getGenre() {
return this.genre;
}
public void setGenre(Integer genre) {
this.genre = genre;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getCategory() {
return this.category;
}
public void setCategory(Integer category) {
this.category = category;
}
public Integer getValidity() {
return this.validity;
}
public void setValidity(Integer validity) {
this.validity = validity;
}
public String getUnit() {
return this.unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getPrice() {
return this.price;
}
public void setPrice(String price) {
this.price = price;
}
public String getRevise() {
return this.revise;
}
public void setRevise(String revise) {
this.revise = revise;
}
public String getGross() {
return this.gross;
}
public void setGross(String gross) {
this.gross = gross;
}
public String getDeadline() {
return this.deadline;
}
public void setDeadline(String deadline) {
this.deadline = deadline;
}
public String getExplain() {
return this.explain;
}
public void setExplain(String explain) {
this.explain = explain;
}
public String getImgurl() {
return this.imgurl;
}
public void setImgurl(String imgurl) {
this.imgurl = imgurl;
}
public Integer getCondition() {
return this.condition;
}
public void setCondition(Integer condition) {
this.condition = condition;
}
public Date getTimes() {
return this.times;
}
public void setTimes(Date times) {
this.times = times;
}
public Integer getRetainday() {
return this.retainday;
}
public void setRetainday(Integer retainday) {
this.retainday = retainday;
}
public String getReport() {
return this.report;
}
public void setReport(String report) {
this.report = report;
}
public Integer getState() {
return this.state;
}
public void setState(Integer state) {
this.state = state;
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof ProductviewId))
return false;
ProductviewId castOther = (ProductviewId) other;
return ((this.getId() == castOther.getId()) || (this.getId() != null
&& castOther.getId() != null && this.getId().equals(
castOther.getId())))
&& ((this.getUsername() == castOther.getUsername()) || (this
.getUsername() != null
&& castOther.getUsername() != null && this
.getUsername().equals(castOther.getUsername())))
&& ((this.getGenre() == castOther.getGenre()) || (this
.getGenre() != null
&& castOther.getGenre() != null && this.getGenre()
.equals(castOther.getGenre())))
&& ((this.getName() == castOther.getName()) || (this.getName() != null
&& castOther.getName() != null && this.getName()
.equals(castOther.getName())))
&& ((this.getTitle() == castOther.getTitle()) || (this
.getTitle() != null
&& castOther.getTitle() != null && this.getTitle()
.equals(castOther.getTitle())))
&& ((this.getCategory() == castOther.getCategory()) || (this
.getCategory() != null
&& castOther.getCategory() != null && this
.getCategory().equals(castOther.getCategory())))
&& ((this.getValidity() == castOther.getValidity()) || (this
.getValidity() != null
&& castOther.getValidity() != null && this
.getValidity().equals(castOther.getValidity())))
&& ((this.getUnit() == castOther.getUnit()) || (this.getUnit() != null
&& castOther.getUnit() != null && this.getUnit()
.equals(castOther.getUnit())))
&& ((this.getPrice() == castOther.getPrice()) || (this
.getPrice() != null
&& castOther.getPrice() != null && this.getPrice()
.equals(castOther.getPrice())))
&& ((this.getRevise() == castOther.getRevise()) || (this
.getRevise() != null
&& castOther.getRevise() != null && this.getRevise()
.equals(castOther.getRevise())))
&& ((this.getGross() == castOther.getGross()) || (this
.getGross() != null
&& castOther.getGross() != null && this.getGross()
.equals(castOther.getGross())))
&& ((this.getDeadline() == castOther.getDeadline()) || (this
.getDeadline() != null
&& castOther.getDeadline() != null && this
.getDeadline().equals(castOther.getDeadline())))
&& ((this.getExplain() == castOther.getExplain()) || (this
.getExplain() != null
&& castOther.getExplain() != null && this.getExplain()
.equals(castOther.getExplain())))
&& ((this.getImgurl() == castOther.getImgurl()) || (this
.getImgurl() != null
&& castOther.getImgurl() != null && this.getImgurl()
.equals(castOther.getImgurl())))
&& ((this.getCondition() == castOther.getCondition()) || (this
.getCondition() != null
&& castOther.getCondition() != null && this
.getCondition().equals(castOther.getCondition())))
&& ((this.getTimes() == castOther.getTimes()) || (this
.getTimes() != null
&& castOther.getTimes() != null && this.getTimes()
.equals(castOther.getTimes())))
&& ((this.getRetainday() == castOther.getRetainday()) || (this
.getRetainday() != null
&& castOther.getRetainday() != null && this
.getRetainday().equals(castOther.getRetainday())))
&& ((this.getReport() == castOther.getReport()) || (this
.getReport() != null
&& castOther.getReport() != null && this.getReport()
.equals(castOther.getReport())))
&& ((this.getState() == castOther.getState()) || (this
.getState() != null
&& castOther.getState() != null && this.getState()
.equals(castOther.getState())));
}
public int hashCode() {
int result = 17;
result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
result = 37 * result
+ (getUsername() == null ? 0 : this.getUsername().hashCode());
result = 37 * result
+ (getGenre() == null ? 0 : this.getGenre().hashCode());
result = 37 * result
+ (getName() == null ? 0 : this.getName().hashCode());
result = 37 * result
+ (getTitle() == null ? 0 : this.getTitle().hashCode());
result = 37 * result
+ (getCategory() == null ? 0 : this.getCategory().hashCode());
result = 37 * result
+ (getValidity() == null ? 0 : this.getValidity().hashCode());
result = 37 * result
+ (getUnit() == null ? 0 : this.getUnit().hashCode());
result = 37 * result
+ (getPrice() == null ? 0 : this.getPrice().hashCode());
result = 37 * result
+ (getRevise() == null ? 0 : this.getRevise().hashCode());
result = 37 * result
+ (getGross() == null ? 0 : this.getGross().hashCode());
result = 37 * result
+ (getDeadline() == null ? 0 : this.getDeadline().hashCode());
result = 37 * result
+ (getExplain() == null ? 0 : this.getExplain().hashCode());
result = 37 * result
+ (getImgurl() == null ? 0 : this.getImgurl().hashCode());
result = 37 * result
+ (getCondition() == null ? 0 : this.getCondition().hashCode());
result = 37 * result
+ (getTimes() == null ? 0 : this.getTimes().hashCode());
result = 37 * result
+ (getRetainday() == null ? 0 : this.getRetainday().hashCode());
result = 37 * result
+ (getReport() == null ? 0 : this.getReport().hashCode());
result = 37 * result
+ (getState() == null ? 0 : this.getState().hashCode());
return result;
}
}
<!----><class catalog="machine" table="productview" schema="dbo" name="com.longge.vo.Productview"></class>
<hibernate-mapping>
<class name="com.longge.vo.Productview" table="productview" schema="dbo" catalog="machine">
<composite-id name="id" class="com.longge.vo.ProductviewId">
<key-property name="id" type="integer">
<column name="id" />
</key-property>
<key-property name="username" type="string">
<column name="username" length="20" />
</key-property>
<key-property name="genre" type="integer">
<column name="genre" />
</key-property>
<key-property name="name" type="string">
<column name="name" length="50" />
</key-property>
<key-property name="title" type="string">
<column name="title" length="50" />
</key-property>
<key-property name="category" type="integer">
<column name="category" />
</key-property>
<key-property name="validity" type="integer">
<column name="validity" />
</key-property>
<key-property name="unit" type="string">
<column name="unit" length="10" />
</key-property>
<key-property name="price" type="string">
<column name="price" length="10" />
</key-property>
<key-property name="revise" type="string">
<column name="revise" length="10" />
</key-property>
<key-property name="gross" type="string">
<column name="gross" length="10" />
</key-property>
<key-property name="deadline" type="string">
<column name="deadline" length="10" />
</key-property>
<key-property name="explain" type="string">
<column name="explain" length="1000" />
</key-property>
<key-property name="imgurl" type="string">
<column name="imgurl" length="100" />
</key-property>
<key-property name="condition" type="integer">
<column name="condition" />
</key-property>
<key-property name="times" type="timestamp">
<column name="times" length="16" />
<key-property>
<key-property name="retainday" type="integer">
<column name="retainday" />
<key-property>
<key-property name="report" type="string">
<column name="report" length="50" />
<key-property>
<key-property name="state" type="integer">
<column name="state" />
<key-property>
<composite-id>
</class>
</hibernate-mapping>
这些我都用myeclipse自动生成的,信息大家也知道,不过我怎么都查询不了!网上找了资料也不行!
List list=dao.query("FROM Productview as pr");
Iterator iterator=list.iterator();
while(iterator.hasNext()){
Productview prw=(Productview)iterator.next();
ProductviewId prid=prw.getId();
log.info(prid.getId());
}
抛出异常:
java.lang.NullPointerException
com.longge.action.PaginAction.ztest(PaginAction.java:503)
如果加where条件,就会抛出别一个异常,希望大家!
相关推荐
hibernate-commons-annotations-4.0.1.Final.jar hibernate-core-4.1.12.Final.jar hibernate-ehcache-4.1.12.Final.jar hibernate-entitymanager-4.1.12.Final.jar hibernate-jpa-2.0-api-1.0.1.Final.jar ...
赠送jar包:hibernate-jpa-2.1-api-1.0.2.Final.jar; 赠送原API文档:hibernate-jpa-2.1-api-1.0.2.Final-javadoc.jar; 赠送源代码:hibernate-jpa-2.1-api-1.0.2.Final-sources.jar; 赠送Maven依赖信息文件:...
赠送jar包:hibernate-jpa-2.1-api-1.0.2.Final.jar; 赠送原API文档:hibernate-jpa-2.1-api-1.0.2.Final-javadoc.jar; 赠送源代码:hibernate-jpa-2.1-api-1.0.2.Final-sources.jar; 赠送Maven依赖信息文件:...
hibernate-jpa-2.1-api-1.0.0.final-sources.jar 源码 hibernate-jpa-2.1-api-1.0.0.final-sources.jar 源码
很多人为了配置jpa找这个动态产生字节码的jar文件,hibernate-distribution-3.3.1.GA包太大,而hibernate-distribution-3.3.2.GA的jar没有这个jar文件,希望对大家有用
hibernate-annotations-3.4.0.GA hibernate-annotations-3.4.0.GA hibernate-annotations-3.4.0.GA
hibernate-commons-annotations-5.0.1.Final.jar的源码
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-release-4.3.10.Final.zip 官方原版,因上传文件大小限制,去掉里面的project
hibernate-release-4.0.0.Final.zip
hibernate-jpa-2.1-api-1.0.0.final.jar.zip,内含hibernate-jpa-2.1-api-1.0.0.final.jar
使用hibernate-validator 进行校验的jar包,里面包括了基础hibernate-validator-5.0.0.CR2.jar hibernate-validator-annotation-processor-5.0.0.CR2.jar 之外,还包括了el-api-2.2.jar javax.el-2.2.4等项目必不可...
hibernate-release-5.3.7.Final
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-release-5.1.0.Final
hibernate-release-5.0.7.Final压缩包 -document -lib -project 内部Hibernate依赖库: antlr-2.7.7.jar dom4j-1.6.1.jar geronimo-jta_1.1_spec-1.1.1.jar hibernate-commons-annotations-5.0.1.Final.jar ...
hibernate-configuration-3.0.dtd、hibernate-mapping-3.0.dtd、hibernate.properties(5.0.7)
hibernate-jpa-2.1-api-1.0.0.Final.jar官方下载,请放心使用
Hibernate稳定版(hibernate-release-5.3.23.Final.zip),Hibernate ORM 是一个为应用程序、库和框架提供对象/关系映射 (ORM) 支持的库。它还提供了 JPA 规范的实现,这是 ORM 的标准 Java 规范。
hibernate-jpa-2.0-api-1.0.1.Final-sources.jar hibernate jpa 源代码