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-jpa-2.0-api-1.0.1.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final-sources.jar hibernate jpa 源代码
hibernate-commons-annotations-4.0.1.Final.jar
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 ...
因为Hibernate在读出hbm.xml文件时需要通过网络读取到hibernate-mapping-3.0.dtd 文件。 如果没有网络不能正常工作。 所以提供上述文件。 以及hibernate-mapping-3.0.dtd,hibernate-configuration-3.0.dtd提供下载...
hibernate-mapping-3.0.dtd 最新从官网下载,无损无修改
hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-entitymanager-3.4.0.GA.rar hibernate-...
而`hibernate-extensions-2.1.3.zip`则包含了一系列对Hibernate原生功能的扩展,这些扩展为开发人员提供了更多便利和灵活性。Middlegen,作为`Middlegen-Hibernate-r5.zip`的主要内容,是针对Hibernate的一个实用...
hibernate-configuration-3.0.dtd 文件,配置后 映射文件就会提示
java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil 或javax/persistence/entitylistener问题
hibernate-core-3.3.2.GA.jar
这个包是最高版本了,google code是1.22,但是这个版本是基础班的1.5版本.是github上源代码经过我打包出来的jar
hibernate 最新的开发包, 网上搜了下, 国内居然很少有最新版的下载资源, 从官方网站下载下来传CSDN上, 但是大小限制只能70M, 所以只能放到百度云盘.
hibernate-release-5.0.2.Final API.chm 参考文档,有了这个,就不用联网查看API参考文档了
hibernate-core-4.2.0.Final-sources.jar hibernate的源代码
标题中的“hibernate-search-orm-5.0.0.Alpha1.zip”指的是Hibernate Search ORM的一个早期版本,它是Hibernate框架的一个扩展,提供了在数据库中进行全文搜索和索引的功能。Hibernate是一个广泛使用的Java对象关系...
hibernate-envers-4.2.4.Final.jar
综上所述,hibernate-release-4.3.8.Final是Hibernate框架的一个成熟版本,它提供了一整套完善的ORM解决方案,包括对象关系映射、事务管理、查询语言、缓存机制以及事件监听等功能。对于Java开发人员来说,熟练掌握...
hibernate-ehcache-4.1.0.Final.jar 是hibernate4.1使用缓存的jar包