You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-user@jakarta.apache.org by Paul Hammant <Pa...@yahoo.com> on 2001/10/30 23:33:24 UTC

AvalonDB

Folks,

I'm using BCEL to generate strongly typed tables and queries in the 
Avalon-Cornerstone/app/DB sub-project.  I'm making good progress.

I'm unsure how I'll get it working in a classloader.  Let me illustrate 
some background:

1) The SQL "create table Employee ( name varchar , sex char )" ...

2) Makes a classes like so...

    public class Employee extends AbstractTable {
        EmployeeRow[] rows;
    }
    public class EmployeeRow extends AbstractTableRow{
        public String name;
        public String sex;
    }

The issue:

There used to be a method .dump() on JavaClass that allowed the .class 
file to be written to disk.  My gut feeling is that that was not meant 
to be used for a real system where dynamic class generation is key.  I 
can understand how a classloader may make additional classes available 
to a the system for instantiation, but how would the same class be 
replaced with a later version of the same thing.

What I mean is that I intend to allow the ALTER TABLE sql feature to 
allow table changes.  Would I a) build a new version of the same class 
with newer features, or b) patch the existing class to have new features 
using BCEL.  If (a) can the class be replaced in a class loader or would 
it have to be added as a subtly different class (because the classloader 
can have a second class with a the same name as one previously loaded).

Phew, I hope you understand....

Regards,

- Paul H


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>