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条件,就会抛出别一个异常,希望大家!
相关推荐
- 黑板系统:知识源、黑板和控制组件,常见于复杂问题求解,如语音识别。 - 超文本系统:支持网状链接,如互联网上的超链接。 - 闭环(过程)控制:发出命令并接收反馈,用于自动化控制,如温度调节。 - C2风格...
假设火车速度为v,他们跑出的五分之二隧道长度等于火车行驶的总距离加上他们跑出的距离,可以列出方程求解火车速度。 8. **Oracle常用语句及存储过程**:Oracle数据库中,DML语句(INSERT、UPDATE、DELETE)用于...
它简化了数据库操作,将Java对象与数据库表进行映射,避免了传统的SQL查询编写,降低了数据库操作的复杂性。在排课系统中,Hibernate可以方便地处理课程、教师、教室等实体对象的增删改查,确保数据的一致性和完整性...
- **Struts**:作为MVC(Model-View-Controller)框架的一部分,负责处理用户请求,协调模型和视图,提供了一种结构化的控制层解决方案。在组卷系统中,Struts可以接收用户输入的组卷参数,调用业务逻辑,然后将结果...
控制器负责处理用户请求,模型处理业务逻辑,视图则展示数据。 2. **Spring框架**:作为Java领域的主流框架,Spring在Kaya-CMS中起到关键作用。它提供了依赖注入(DI)、面向切面编程(AOP)以及服务容器等功能,...
3. **Struts框架**:Struts框架主要用于构建MVC架构的Web应用,其核心思想是分离显示逻辑和业务逻辑,通过控制器(Controller)转发请求到模型(Model)和视图(View)。 ### 算法与数据结构 1. **冒泡排序**:...
它提供了依赖注入、AOP(面向切面编程)、MVC(模型-视图-控制器)等特性,简化了项目开发。物流配货网可能采用了Spring Boot,它是Spring的微服务框架,可以快速构建独立运行的Spring应用。 3. 数据库管理:物流...