You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Ben Shory <be...@sapiens.com> on 2008/11/20 11:25:57 UTC

Generating source code from sql statement

Hi,
Is there any way to generate the domain object from a query (from
multiple tables) and not from a table?

Re: Generating source code from sql statement

Posted by Larry Meadors <la...@gmail.com>.
On Thu, Nov 20, 2008 at 3:25 AM, Ben Shory <be...@sapiens.com> wrote:
> Is there any way to generate the domain object from a query (from multiple tables) and not from a table?

That's kind of an interesting idea - you could do that from JDBC's
resultset metadata...someone ought to build that. :)

Larry

Re: Generating source code from sql statement

Posted by Alex Shneyderman <a....@gmail.com>.
it will not work 100% as types will be messed up - just so you know
that there will be the need for manual over-write option :-).
JDBC often (about 20% for oracle jdbc driver) mis-reports types for
the fields on the views and sometimes it simply has no way
to detect them.

On Thu, Nov 20, 2008 at 2:35 PM, Ben Shory <be...@sapiens.com> wrote:
> Thanks, i will automate a view creation form my queries and than generate
> the sources.
> ________________________________
> From: Dan Turkenkopf [mailto:dturkenk@gmail.com]
> Sent: Thursday, November 20, 2008 2:51 PM
> To: user-java@ibatis.apache.org
> Subject: Re: Generating source code from sql statement
>
> Hi Ben,
>
> You can't generate from a query, but you can generate from a view.
>
> I don't know if that will help in your case, but it is an option.
>
> Regards,
> Dan Turkenkopf
>
> On Thu, Nov 20, 2008 at 5:53 AM, charlie bird <ze...@yahoo.co.uk> wrote:
>>
>> Don't think so.
>> I've always pointed A(I)Bator at one the tables in the query and then hand
>> coded the rest - Doesn't take very long.
>>
>>
>> --- On Thu, 20/11/08, Ben Shory <be...@sapiens.com> wrote:
>>
>> > From: Ben Shory <be...@sapiens.com>
>> > Subject: Generating source code from sql statement
>> > To: user-java@ibatis.apache.org
>> > Date: Thursday, 20 November, 2008, 10:25 AM
>> > Hi,
>> > Is there any way to generate the domain object from a query
>> > (from
>> > multiple tables) and not from a table?
>>
>>
>>
>
>

RE: Generating source code from sql statement

Posted by Ben Shory <be...@sapiens.com>.
Thanks, i will automate a view creation form my queries and than
generate the sources.

________________________________

From: Dan Turkenkopf [mailto:dturkenk@gmail.com] 
Sent: Thursday, November 20, 2008 2:51 PM
To: user-java@ibatis.apache.org
Subject: Re: Generating source code from sql statement


Hi Ben,

You can't generate from a query, but you can generate from a view.

I don't know if that will help in your case, but it is an option.

Regards,
Dan Turkenkopf


On Thu, Nov 20, 2008 at 5:53 AM, charlie bird <ze...@yahoo.co.uk>
wrote:


	Don't think so.
	I've always pointed A(I)Bator at one the tables in the query and
then hand coded the rest - Doesn't take very long.
	
	
	--- On Thu, 20/11/08, Ben Shory <be...@sapiens.com> wrote:
	
	> From: Ben Shory <be...@sapiens.com>
	> Subject: Generating source code from sql statement
	> To: user-java@ibatis.apache.org
	> Date: Thursday, 20 November, 2008, 10:25 AM
	
	> Hi,
	> Is there any way to generate the domain object from a query
	> (from
	> multiple tables) and not from a table?
	
	
	
	



Re: Generating source code from sql statement

Posted by Dan Turkenkopf <dt...@gmail.com>.
Hi Ben,

You can't generate from a query, but you can generate from a view.

I don't know if that will help in your case, but it is an option.

Regards,
Dan Turkenkopf

On Thu, Nov 20, 2008 at 5:53 AM, charlie bird <ze...@yahoo.co.uk> wrote:

> Don't think so.
> I've always pointed A(I)Bator at one the tables in the query and then hand
> coded the rest - Doesn't take very long.
>
>
> --- On Thu, 20/11/08, Ben Shory <be...@sapiens.com> wrote:
>
> > From: Ben Shory <be...@sapiens.com>
> > Subject: Generating source code from sql statement
> > To: user-java@ibatis.apache.org
> > Date: Thursday, 20 November, 2008, 10:25 AM
> > Hi,
> > Is there any way to generate the domain object from a query
> > (from
> > multiple tables) and not from a table?
>
>
>
>

Re: Generating source code from sql statement

Posted by charlie bird <ze...@yahoo.co.uk>.
Don't think so.
I've always pointed A(I)Bator at one the tables in the query and then hand coded the rest - Doesn't take very long.


--- On Thu, 20/11/08, Ben Shory <be...@sapiens.com> wrote:

> From: Ben Shory <be...@sapiens.com>
> Subject: Generating source code from sql statement
> To: user-java@ibatis.apache.org
> Date: Thursday, 20 November, 2008, 10:25 AM
> Hi,
> Is there any way to generate the domain object from a query
> (from
> multiple tables) and not from a table?