Creating the Java Objects"
From Documentation
(Created page with '{{ZKDevelopersGuidePageHeader}} You have to create simple JavaBean class with some properties. # Create your first Java class (<tt>Event.java</tt>) <source lang="java" > pac…') |
m (correct highlight (via JWB)) |
||
Line 4: | Line 4: | ||
You have to create simple JavaBean class with some properties. | You have to create simple JavaBean class with some properties. | ||
− | # Create your first Java class (< | + | # Create your first Java class (<code>Event.java</code>) |
<source lang="java" > | <source lang="java" > | ||
Line 38: | Line 38: | ||
</source> | </source> | ||
− | # You have to compile the Java source, and place the class file in a directory called < | + | # You have to compile the Java source, and place the class file in a directory called <code>classes</code> in the Web development folder, and in its correct package. (ex.<code>$myApp/WEB-INF/classes/event/Event.class</code>) |
The next step is to tell Hibernate how to map this persistent class with database. | The next step is to tell Hibernate how to map this persistent class with database. | ||
{{ ZKDevelopersGuidePageFooter}} | {{ ZKDevelopersGuidePageFooter}} |
Latest revision as of 10:38, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
You have to create simple JavaBean class with some properties.
- Create your first Java class (
Event.java
)
package events;
import java.util.Date;
public class Event {
private Long id;
private String title;
private Date date;
public Event() {}
public Long getId() {
return id;
}
private void setId(Long id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
- You have to compile the Java source, and place the class file in a directory called
classes
in the Web development folder, and in its correct package. (ex.$myApp/WEB-INF/classes/event/Event.class
)
The next step is to tell Hibernate how to map this persistent class with database.