You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@empire-db.apache.org by phil barrett <pb...@yahoo.co.uk> on 2010/01/04 08:18:16 UTC

Database Engine and Dynamic Data Model

Hi, Simple question first, is there some place where from Empire-db you can tell mysql what database engine to use, innodb, myisam etc?

Secondly.using the advanced sample as an example and I might be confused here..
You
start with a concrete class that shows the database attributes and can
use this in your coding to circumvent the problem with using quoted
names. If you then have some code that changes the database to add an
attribute, it changes the database but does not change the class to add
the attribute so the class and the database are now out of sync?

Regards Phil



      

Re: Database Engine and Dynamic Data Model

Posted by Francis De Brabandere <fr...@gmail.com>.
On Tue, Jan 5, 2010 at 9:48 AM, phil barrett <pb...@yahoo.co.uk> wrote:
> Hi Francis, per database I imagine would be better.

I created a jira issue:
https://issues.apache.org/jira/browse/EMPIREDB-67

>
> And with the dynamic class it might be sort of useful to have it create a
> class on the fly which would then be saved.

We are working on a code generator which generates java sources from
an existing database. But of course it only generates source code and
not .class files.

Could you tell us your use case?

Cheers,
Francis

>
> regards Phil
>
> ________________________________
> From: Francis De Brabandere <fr...@gmail.com>
> To: empire-db-user@incubator.apache.org
> Sent: Tue, 5 January, 2010 9:39:26
> Subject: Re: Database Engine and Dynamic Data Model
>
> Hi Phil,
>
> On Mon, Jan 4, 2010 at 8:18 AM, phil barrett <pb...@yahoo.co.uk> wrote:
>> Hi, Simple question first, is there some place where from Empire-db you
>> can
>> tell mysql what database engine to use, innodb, myisam etc?
>
> For now this is not implemented in our mysql driver:
> "CREATE DATABASE " + databaseName + " CHARACTER SET " + characterSet
>
> Would you like to set this per database or globally?
>
>>
>> Secondly.using the advanced sample as an example and I might be confused
>> here..
>> You start with a concrete class that shows the database attributes and can
>> use this in your coding to circumvent the problem with using quoted names.
>> If you then have some code that changes the database to add an attribute,
>> it
>> changes the database but does not change the class to add the attribute so
>> the class and the database are now out of sync?
>
> At runtime, as long as you don't create more than one instance of your
> DBDatabase class there is no problem:
> // First, add a new column to the Table object
> DBTableColumn C_FOO = db.T_EMPLOYEES.addColumn("FOO", DataType.TEXT, 20,
> false);
> ... we run ddl ...
> //
>
> But of course after restarting the application you loose this information...
>
> Cheers,
> Francis
>
> --
> http://www.somatik.be
> Microsoft gives you windows, Linux gives you the whole house.
>
>



-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

Re: Database Engine and Dynamic Data Model

Posted by phil barrett <pb...@yahoo.co.uk>.
Hi Francis, per database I imagine would be better.

And with the dynamic class it might be sort of useful to have it create a class on the fly which would then be saved.

regards Phil




________________________________
From: Francis De Brabandere <fr...@gmail.com>
To: empire-db-user@incubator.apache.org
Sent: Tue, 5 January, 2010 9:39:26
Subject: Re: Database Engine and Dynamic Data Model

Hi Phil,

On Mon, Jan 4, 2010 at 8:18 AM, phil barrett <pb...@yahoo.co.uk> wrote:
> Hi, Simple question first, is there some place where from Empire-db you can
> tell mysql what database engine to use, innodb, myisam etc?

For now this is not implemented in our mysql driver:
"CREATE DATABASE " + databaseName + " CHARACTER SET " + characterSet

Would you like to set this per database or globally?

>
> Secondly.using the advanced sample as an example and I might be confused
> here..
> You start with a concrete class that shows the database attributes and can
> use this in your coding to circumvent the problem with using quoted names.
> If you then have some code that changes the database to add an attribute, it
> changes the database but does not change the class to add the attribute so
> the class and the database are now out of sync?

At runtime, as long as you don't create more than one instance of your
DBDatabase class there is no problem:
// First, add a new column to the Table object
DBTableColumn C_FOO = db.T_EMPLOYEES.addColumn("FOO", DataType.TEXT, 20, false);
... we run ddl ...
//

But of course after restarting the application you loose this information...

Cheers,
Francis

-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.



      

Re: Database Engine and Dynamic Data Model

Posted by Francis De Brabandere <fr...@gmail.com>.
Hi Phil,

On Mon, Jan 4, 2010 at 8:18 AM, phil barrett <pb...@yahoo.co.uk> wrote:
> Hi, Simple question first, is there some place where from Empire-db you can
> tell mysql what database engine to use, innodb, myisam etc?

For now this is not implemented in our mysql driver:
"CREATE DATABASE " + databaseName + " CHARACTER SET " + characterSet

Would you like to set this per database or globally?

>
> Secondly.using the advanced sample as an example and I might be confused
> here..
> You start with a concrete class that shows the database attributes and can
> use this in your coding to circumvent the problem with using quoted names.
> If you then have some code that changes the database to add an attribute, it
> changes the database but does not change the class to add the attribute so
> the class and the database are now out of sync?

At runtime, as long as you don't create more than one instance of your
DBDatabase class there is no problem:
// First, add a new column to the Table object
DBTableColumn C_FOO = db.T_EMPLOYEES.addColumn("FOO", DataType.TEXT, 20, false);
... we run ddl ...
//

But of course after restarting the application you loose this information...

Cheers,
Francis

-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.