Creating the Java Objects

From Documentation
Creating the Java Objects

Stop.png 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.

  1. Create your first Java class (
 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) { = id;
     public Date getDate() {
         return date;
     public void setDate(Date date) { = date;
     public String getTitle() {
         return title;
     public void setTitle(String title) {
         this.title = title;
  1. 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.

Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.