incubator-empire-db-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phil barrett <pbx9...@yahoo.co.uk>
Subject Re: Database Engine and Dynamic Data Model
Date Wed, 06 Jan 2010 14:39:21 GMT
Hi Rainier, OK I'll do the mysql change. I'll keep you informed when I have done it.

Dynamic data model. My use case was to allow users to actually define data changes on the
fly, of course one they had done that I then had some inconsistency between the class and
the model. Naturally I would probably have all sorts of differences to resolve in some source
control also even if I allow on the fly class creation. I'll have a think about this some
more and see if I come up with some generalised sample and a solution.

Regards Phil




________________________________
From: Rainer Döbele <doebele@esteam.de>
To: empire-db-user@incubator.apache.org
Sent: Wed, 6 January, 2010 11:40:42
Subject: re: Database Engine and Dynamic Data Model

Hi phil,

I agree that the selection of the storage technology is an important feature in MySQL that
is currently missing when letting Empire-db create your database.
As it looks like you are more of an MySQL expert than we are and we rely on the assistance
of our users to improve our product.

So if you would like to help us I suggest the following:
1. make a copy of our class org.apache.empire.db.mysql.DBDatabaseDriverMySQL in your code
and rename it to something like ImprovedMySQLDriver. Unfortunately the important methods for
this change are all private rather than protected and cannot be overridden at the moment.

2. Create an enumeration and a corresponding property that allows setting the engine type.
3. Modify the private method "createDatabase" so that the database engine is properly set
from the state of the property.
4. Use this class instead of the original "DBDatabaseDriverMySQL" in your application.
5. If all works well (you may also think of other improvements) we would be grateful to receive
a copy of your source file so that we can change our implementation accordingly.

Would that be OK for you?

About the dynamic data model change: This feature may be useful for applications which let
the user define "user defined fields". But of course those applications have to implement
a way to keep track of those user changes themselves e.g. by using a table that stores those
user definitions. On application start the definition classes can then be restored. There
is not much more we could do at this point.

Regards
Rainer



phil barrett wrote:
> Re: Database Engine and Dynamic Data Model
> 
> 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 <francisdb@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 <pbx9959@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.


      
Mime
View raw message