Share on Google+Share on Google+

Praveena Naregudem
hibernate pojo setter method problem
1 Answer(s)      6 years and 5 months ago
Posted in : Hibernate

how to pass a date type variable to a setter method in hibernate pojo class? //this is my pojo class

import java.util.*; public class Employee { private String empname; private int empcode; private int empsal; private Date empDob; private Date empDoa; public String getEmpname() { return empname; } public void setEmpname(String empname) { this.empname = empname; } public int getEmpcode() { return empcode; } public void setEmpcode(int empcode) { this.empcode = empcode; } public int getEmpsal() { return empsal; } public void setEmpsal(int empsal) { this.empsal = empsal; } public Date getEmpDob() { return empDob; } public void setEmpDob(Date empDob) { this.empDob = empDob; } public Date getEmpDoa() { return empDoa; } public void setEmpDoa(Date empDoa) { this.empDoa = empDoa; }


//this is my client class code

import org.hibernate.*; import org.hibernate.cfg.*; public class Client { public static void main(String args[]) { Session session=new Configuration().configure().buildSessionFactory().openSession(); Employee e = new Employee();


    Transaction tx=session.beginTransaction();;



//along with them I have cfg and hbm files , and I am getting this Exeception

Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setEmpDob(Date) in the type Employee is not applicable for the arguments (int) The literal 09 of type int is out of range The method setEmpDoa(Date) in the type Employee is not applicable for the arguments (int)

at Client.main(




View Answers

November 23, 2010 at 10:54 AM

Hi Friend,

Please visit the following link:

Hibernate Tutorials


Related Tutorials/Questions & Answers:
hibernate pojo setter method problem
hibernate pojo setter method problem  how to pass a date type variable to a setter method in hibernate pojo class? //this is my pojo class import...: Unresolved compilation problems: The method setEmpDob(Date) in the type
Hibernate create POJO classes
Hibernate create POJO classes In this tutorial you will learn how to create a POJO class in Hibernate. POJO (Plain Old Java Object) is a programming model... be avoidable because hibernate's feature proxies depends upon the POJO
pojo class having problem
pojo class having problem  Cannot find any information on property 'Username' in a bean of type 'LoginBean.LoginBeanClass' org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(
pojo generation - Hibernate
pojo generation  Can we create a pojo from a data of two different tables
Hibernate code problem - Hibernate
Hibernate code problem  Hi, This is Birendra Pradhan.I want... & Regards Birendra  Hi friend, For solving the problem visit to : Thanks
Hibernate code problem - Hibernate
Hibernate code problem  Hi This is Raju.I tried the first example of Hibernate material what u have given. I have written session.flush(); i am using hibernate 3.3.1 and I kept hibernate3.jar
hibernate code problem - Hibernate
hibernate code problem  suppose i want to fetch a row from the table... . Please visit for more information. If you have any problem this send me detail and source code
hibernate problem
hibernate problem  please help me.... log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please...:12) i am getting this prob while running my hibernate program in Eclips please
Hibernate code problem - Hibernate
Hibernate code problem  how to write hibernate Left outer join program
Hibernate code problem - Hibernate
Hibernate code problem   Hi This is Raju I tried the first example of hibernate course material.This is to insert a record into CONTACT table.Is Hibernate code automatically creates the CONTACT table and then insert
hibernate insertion problem - Hibernate
hibernate insertion problem  Hi , Thanks for the material .Its very gud . when i run i get the message insertion has been done int the table contact . but whne i look into database data is not inserted
hibernate code problem - Hibernate
hibernate code problem  String SQL_QUERY =" from Insurance...: " + insurance. getInsuranceName()); } in the above code,the hibernate...= request.getParameter("name"); For more information on hibernate visit to : http
Eclipse hibernate problem
Eclipse hibernate problem  hie..i've just started a basic hibernate... and created a pojo class. I have created HibernateUtil class but I'm getting...;Hibernate Eclipse Integration Hibernate Tutorials
Hibernate code problem - Hibernate
Hibernate code problem  Hai, iam working on simple login application using hibernate in spring. I've used Spring dependency injection too.I struck at DAO(data access Object)layer while executing the select statement in HQL
delete() method of hibernate
delete() method of hibernate  Define the use of delete() method of hibernate? Example
problem related to onSubmit() method
problem related to onSubmit() method  Hello, I am developing application.when i submit form at that time formBacking() method is call...Instead of that onSubmit() should have to call .... please help me
Hibernate saveOrUpdate Method
Hibernate saveOrUpdate Method In this tutorial you will learn about the saveOrUpdate method in Hibernate. Hibernate's saveOrUpdate method inserts the new...() method can be used in Hibernate. For this I am giving a complete source code
Hibernate update Method
Hibernate update Method In this tutorial you will learn about the update method in Hibernate Hibernate's update method saves the modified value... an update method of Hibernate to update the record of table. Complete Code
Pojo and java beans
Pojo and java beans  Can anyone tell me where we should use pojo class and where we should use beans. We use pojo class to make the object of mapping file in hibernate framework. Can I use pojo class in those applications where
Problem with Hibernate or 11g
Problem with Hibernate or 11g  Hi I am using Hibernate and 11g in my project. The problem I am facing is I am executing a query from java class... on Created date column by using hibernate query language. The Problem is every
Setter injection in Spring
Setter injection in Spring  What is Setter injection in Spring ?   The Spring IoC container supports setter injection, which is the preferred method of dependency injection in Spring. Setter injection uses the set
Problem in updating query in Hibernate - Hibernate
Problem in updating query in Hibernate  Hi, I have used a query to update the existing columns of one table. The query updates the records..., Please visit the following link:
Use of delete() method in hibernate.
Use of delete() method in hibernate.  Define the use of delete() method of hibernate?   Hibernate provide the facility to delete one row...(object); transaction.commit(); } } Output: Hibernate: select
Hibernate persist Method
Hibernate persist Method In this tutorial you will learn about how to use persist method in hibernate. Hibernate's persist() method is used to insert... (primary key) value that is generated by the hibernate but the persist() method
Hibernate session.refresh() method
Hibernate session.refresh() method  What is session.refresh() in hibernate?   It is possible to re-load an object and all its collections at any time, using the refresh() method. This is useful when database triggers
delete query problem - Hibernate
correctly , the problem is only delete query. 2) query.executeUpate(); ->...(); Read for more information. Thanks
Hibernate @ManyToOne persisting problem - Hibernate
Hibernate @ManyToOne persisting problem  hello, In my apllication, there are students and classes. a student can take many classes. So there is OneToMany <--> ManyToOne relationship. Im my case, the best implementation
Problem with open connection - Hibernate
Problem with open connection  Hi Team, I am running one hibernate application and the database is ORACLE 10g.I am getting the below error.I connected to the database by using JDBC(with same driver and url).Please tell me
server problem - Hibernate
server problem  dear sir please give me best soloution how run hibernate and spring application on jboss and weblogic10.1.0 sever and compile thanks
hibernate update problem
hibernate update problem  HI, I integrated the struts and hibernate and wrote the following query in the databean to update the user table login time SessionFactory sessionFactory = (SessionFactory)context.getAttribute
Diff Bn Actionform and Pojo - Struts
Diff Bn Actionform and Pojo   Hi Friends, I am confused with Pojo and ActionForm ,bcoz both have getter and setter methods.In both we declare fields and corresponding getter n setters also.plz  
Java Spring Hibernate Struts Training java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based! org.hibernate.validator cannot be resolved error java.lang.ClassNotFoundException: org.hibernate.cache.TimestampsRegion java.lang.ClassNotFoundException: org.hibernate.cache.TimestampsRegion property hibernate.cache.region.factory_class is not given Hibernate example step by step in Eclipse with MySQL How to make Struts Hibernate and Spring Based Login/Registration Application? What is the use of Hibernate Native SQL? What is the use of Hibernate is used? How to integrate Struts and Hibernate in an application? How to create the program in Java for getting the forgotten Password Form? How to write create JPA Many-to-Many Relationship in Java? What is the DAO Layer in any application? What is Spring Struts Hibernate DAO Layer? How to write Example code for CRUD application in hibernate annotation? Where to update the Hibernate tools? Query conversion convert into hql how to convert sql into hql package org.hibernate.util does not exist C3P0 with Hibernate What do you understand by JPA? Hibernate Query Checker Jpa many to many relationship What do you understand by Hibernate in Java? What are criteria Queries in Hibernate? How to use Associations and Joins in Hibernate? Hibernate 4 Example with Eclipse How to learn Hibernate? What is Hibernate Framework? hibernate faq 15/03/14 hibernate 15/03/2014 Hibernate Criteria Wildcard how to add mulitiple projections this is a hibernate question this is a hibernate question this is a hibernate question how to writw connection pool coding Hibernate 4.3 and JPA 2.1 support How to create Hibernate session factory name? Can you provide me Hibernate configuration tutorial? I want to build sessionfactory in hibernate 4. Need help. I want to learn Hibernate tutorial quickly How to create sessionfactory in Hibernate 4.1.1? How to create sessionfactory in Hibernate 4.1? Hibernate 4.3.0.Final get session How to learn hibernate in 24 hours? hibernate 4.3.0 I want to know how can I create sessionfactory in hibernate 4 (latest version) standard serviceregistrybuilder example


Advertisement null