ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kezerashvili, Denis" <Denis.Kezerashv...@gs.com>
Subject RE: Problem exposing protected setters for iBatis
Date Fri, 09 May 2008 20:22:11 GMT
Does anyone have any suggestion about this issue? Any input will be
greatly appreciated.
 
Denis


________________________________

	From: Kezerashvili, Denis 
	Sent: Thursday, May 08, 2008 12:17 PM
	To: user-java@ibatis.apache.org
	Subject: Problem exposing protected setters for iBatis
	
	

	Here is the problem that I have: 

	I have an Entity class that has a private field ID (the actual
name is id), which contains the db id for the entity persisted. 

	I have a public getId() and protected setId() methods. 
	iBATIS sets id when the record is inserted into the db, nobody
else should be setting the id, therefore the setter is not public.

	I have several classes that extend Entity (User, Address, etc.).

	As long as the classes extending Entity live in the same package
all is good and the ID is being set as expected. But when the child
class is in another package iBATIS seems to be unable to set the id. 

	Is there a way of solving this issue other than making setId()
public? 

	Thank you in advance 

	Denis 


Mime
View raw message