You could create a reference from Honey to Milk, since you have a
"milkid" field there.  Then, you'd use a list of Honey objects and
you'd display these properties:

id
milk.id
name
milk.name




On Fri, Feb 12, 2010 at 3:58 AM, Ivan Dudko <ivan.du...@gmail.com> wrote:
> For example..
> class Honey {
> int id;
> int milkid;
> String name;
> // getters and setters
> }
> class Milk {
> int id;
> String name;
> // getters and setters
> }
>
> and my query:
> SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
> milk.name MILKNAME FROM honey, milk
> WHERE  honey.milkid=milk.id;
>
> And i want to display table with these fields.
>
> Which object i must use?
>
> 2010/2/11 James Carman <jcar...@carmanconsulting.com>:
>> Well, what sort of object do you want to display?  Are you going to
>> just create an Object[] for each row in the table?  Or, are you
>> creating a DTO of some sort?
>>
>> On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko <ivan.du...@gmail.com> wrote:
>>> Thank you.
>>> I already do simple things with hibernate and spring ioc.
>>> Now i want to use plain old jdbc.
>>> I already get the datatable wich works with one pojo (table).
>>> Now i am in trouble.. how i can get table for two joined tables, for 
>>> example?
>>>
>>> 2010/2/11 James Carman <jcar...@carmanconsulting.com>:
>>>> Yeah, but this doesn't give them an example of how to get the results
>>>> out of a JDBC result set.  This is based on a static, in-memory list
>>>> of Contact objects.  What I would recommend is to look at a
>>>> Hibernate-based example and come up with the JDBC analog.  Here's an
>>>> example from my Advanced Wicket talk I gave a while back:
>>>>
>>>> http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.java
>>>>
>>>> At the bottom, there's a data provider which talks to a "repository"
>>>> to get its data.
>>>>
>>>>
>>>>
>>>> On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
>>>> <christian.giamba...@excelsisnet.com> wrote:
>>>>> http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
>>>>>
>>>>> -----Ursprüngliche Nachricht-----
>>>>> Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
>>>>> Gesendet: Donnerstag, 11. Februar 2010 15:47
>>>>> An: users@wicket.apache.org
>>>>> Betreff: Re: jdbc
>>>>>
>>>>> I already have method that return my data from db as arraylist. And i
>>>>> use this in iterator() method of dataprovider.
>>>>> But which object (i think model) i must return?
>>>>>
>>>>> 2010/2/11 James Carman <jcar...@carmanconsulting.com>:
>>>>>> You need to create a "provider" for your data.  Look at what the
>>>>>> constructor takes and then implement the interface.
>>>>>>
>>>>>> On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko <ivan.du...@gmail.com> wrote:
>>>>>>> Hello!
>>>>>>>
>>>>>>> I can't understand how to populate data from a resultset object into 
>>>>>>> datatable.
>>>>>>> Anyone have an example?
>>>>>>>
>>>>>>> Thank you!
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to