Win a copy of Head First Android this week in the Android forum!

Nanda Suraj

+ Follow
since May 04, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nanda Suraj

hi Henrique ,

I have got the same exception. I have given both the mapping inside the hibernate.cfg.xml. But it still shows the exception :

An association from the table refers to an unmapped class: java.lang.ExceptionInInitializerError

have any idea ?
I got it right. Thanks for the help.

I gave wrong type in the hbm.xml file. Instead of long , i gave integer.

Not its working and stored in the table.
Yes, you are correct. When I printed the exception I got :
" identifier of an instance of events.Event was altered from 1 to 1 "

I don't understand why this exception occures ?

Please help me ..

Hi ,

I am a newbie to hibernate. I desperately need to sort a simple example.

I am using oracle as a database. I am trying to work out the example (Event) specified in I cleared of exceptions or errors. But the values giver is not inserting into the table.

The hbm.xml file I wrote is as :

<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID" type="integer" unsaved-value="0">
<generator class="increment"/>
<property name="dt" type="timestamp" column="EVENT_DATE"/>
<property name="title" column="TITLE"/>

and the class that does the transactions is :

* Created on 12 January 2006, 10:33

package events;

import org.hibernate.Session;

import java.util.Date;
import java.util.List;
import util.HibernateUtil;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class EventManager {
private static Log log = LogFactory.getLog(HibernateUtil.class);
public static void main(String[] args) {

EventManager mgr = new EventManager();
long id = 101;
Event eve = new Event();
System.out.println("INSIDE LIST... ");
if (args[0].equals("store")) {

mgr.createAndStoreEvent("My Event", new Date());
else if (args[0].equals("list")) {
List events = mgr.listEvents();
for (int i = 0; i < events.size(); i++) {
Event theEvent = (Event) events.get(i);
System.out.println("Event: " + theEvent.getTitle() +
" Time: " + theEvent.getDt());

private void createAndStoreEvent(String title, Date theDate) {
try {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();

Event theEvent = new Event();

System.out.println("event id : "+theEvent.getId());
System.out.println("event title : "+theEvent.getTitle());

}catch(Exception e){}

private List listEvents() {

Session session = HibernateUtil.getSessionFactory().getCurrentSession();


List result = session.createQuery("from Event").list();


return result;


Anybody have an idea why the values not storing into ?


I attended an interview and they asked me :

* who does the requirement specification ?
* how do you start coding the project ?
* how do you design the project for coding ? etc ..

Actually in our company there is no specific structure ..means there is a project manager, he/she will write the requiremnt spec, which includes screens and explains each field of the csreen. thats all. then we get the databse from a dba. then we understand what are all the classes according to that data model, then start coding not sure what method is am confused when an interviewer asks about this...

please anyone could help me in this ?

I have another one in near future please help me out.

Thanks in advance.

[ June 13, 2005: Message edited by: Nanda Suraj ]
[ June 13, 2005: Message edited by: Nanda Suraj ]
16 years ago
Thanks very much Christopher, I got it.

Thank you very much for your reply.

16 years ago
Sorry Christopher, didn't get your idea. Could you please explain bit more ?

It will be a great healp if you could explain bit more clear.

16 years ago

In my code, I have 3 buttons : save, signoff and cancel. And also I have 2 radio buttons : client and customer. When I press customer radio button, the signoff button should be disabled. How can I do that ? Do any one have an idea please.

For the buttons I use struts html:submit. And I haven't used any business logic on the JSP screen.

Please give me a solution as soon as possible.

16 years ago