openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Himadri <hima_...@yahoo.co.in>
Subject getResultList returns same record at every index with Database view
Date Sat, 10 Jul 2010 11:30:54 GMT

Hi,

I am trying to use a database view with Oracle + Weblogic 10.3 and have
issue with getResultList()
The result list has correct number of records i.e size ,but same record at
every index !!! So am getting only the first record <size> times. 
I have tried to print the record at every index and its the same record .
have verified that teh query returns correct result from oracle prompt.

This works perfectly with table but not with view. View is simple with
annotation. Tested with a simple namedquery.  Here is simple java snippet 

List<PropertyData> props  =
this.em.createNamedQuery("findPropsByName").setParameter(1,
id)getResultList();
		System.out.println("get properties;" + props.size());
if(props != null)
{
			
	for(int i=0;i <props.size();i++)
	{
		PropertyData data = props.get(0);
		System.out.println("index at " + i + " , data is "+data);
		System.out.println(data.getName() + "\t" + data.getObjectId() + "\t" +
data.getObjectType()  );
}

The sysout is like below . 
get properties;3
index at 0 , data is com.tieto.magic.poc.domain.PropertyData@35adce
USERNAME        0       Resource
index at 1 , data is com.tieto.magic.poc.domain.PropertyData@35adce
USERNAME        0       Resource
index at 2 , data is com.tieto.magic.poc.domain.PropertyData@35adce
USERNAME        0       Resource
			
		}
 


Have attached spy log if its gonna help someone identify the issue . Thanks
in advance ! 




http://openjpa.208410.n2.nabble.com/file/n5277490/working.txt working.txt 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/getResultList-returns-same-record-at-every-index-with-Database-view-tp5277490p5277490.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message