commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip, Anil - Kansas City, MO" <>
Subject Commons dbutils - question on populating a bean that has a property that is a list of primitives
Date Thu, 16 Jul 2009 17:46:19 GMT
Can dbutils populate a bean that has a property that is a list of
primitives? (one-to-many relationships)
I looked at the source code but it wasn't clear that it can because a
new bean is created for each row in the result set. BeanProcessor
methods createBean() and processColumn().
For example: 
class Department has property ArrayList<String> employee_name
select department.department_location, employee.employee_name from
department JOIN employee ON = employee.dept_id;
So we get a result set like:
'Kansas City',  'John'
'Kansas City',  'Elisabeth'
'Kansas City',  'David'
'Bangalore',  'Kiran'

It seems that createBean() creates a new Department instance for each
row, rather than retrieve that instance and add the list of other names
to it. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message