-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Enhancement problem
PostPosted: Thu Mar 11, 2004 9:05 am 
Newbie

Joined: Thu Mar 11, 2004 5:39 am
Posts: 13
Hi,
I have an enhancement problem...

******* here is my persisten bean:***************************

public class Bean Serializable{

private String code = null;
private Integer id = null;
private String lb = null;
private List jPages = null;

public String getCode() {
return code;
}

public String getLb() {
return lb;
}

public void setCode(String string) {
if (!string.equals(code)) {
// do something (but anyway continue after if)
}
code = string;
}

public void setLb(String string) {
if (!string.equals(lb)) {
// do something (but anyway continue after if) }
lb = string;
}

public Integer getId() {
return id;
}

public void setId(Integer integer) {
if (!integer.equals(id)) {
// do something (but anyway continue after if) }
id = integer;
}

public List getPages() {
return jPages;
}

public void setPages(List pages) {
jPages = pages;
}

}

*********** here is my mapping file******************************

<hibernate-mapping>
<class name="Bean" table="SWD_TABLE" >
<id name="id" column="J_ID" type="java.lang.Integer">
<generator class="assigned"/>
</id>
<property name="code" column="J_CODE" type="java.lang.String" />
<property name="lb" column="J_LB" type="java.lang.String" />

<list name="jPages" table="PAGE_J" inverse="true" cascade="all" lazy="true">
<key column="J_CODE"/>
<index column="posn"/>
<many-to-many class="PageBean" column="PAGE_ID"/>
</list>
</class>
</hibernate-mapping>


**********I have this message when hibernate starts**************

[11/03/04 13:34:35:286 CET] 48f7d41a Environment I net.sf.hibernate.cfg.Environment using CGLIB reflection optimizer
.
.
.
.
[11/03/04 13:34:41:005 CET] 48f7d41a ReflectHelper I net.sf.hibernate.util.ReflectHelper reflection optimizer disabled for: Bean, BulkBeanException: null (property setCode)





--------------> do you have any idea of what's going on? and what does this message means?

thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 9:14 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
public List getJPages() {
return jPages;
}

public void setJPages(List pages) {
jPages = pages;
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 9:24 am 
Newbie

Joined: Thu Mar 11, 2004 5:39 am
Posts: 13
oops, sorry, I made a mistake copying my code.

setJPages and getJPages are correct.

the error is still there and linked to "setCode" (see first message)..

I still don't understand...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 9:59 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Code:
public void setCode(String string) {
if (!string.equals(code)) {
// do something (but anyway continue after if)
}
code = string;
}


It causes NullPointerException, this is not a very big problem, you can ignore this warning, but do not transaform "string" parameter in setter, it will make your object "dirty" after load.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 10:17 am 
Newbie

Joined: Thu Mar 11, 2004 5:39 am
Posts: 13
this was the problem!
thankxxx!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.