Hi Lukas,

And thank you again for these features! You are really fast developing them.

Couple of new ideas came into my mind during the port:

*Feature proposal 1:*

Currently generated record.store() returns 1 if the record was stored to 
the database. 0 if storing was not necessary.

Proposed functionality: 

Generated XXXRecord.store() returns     
                    1 if the record was inserted to the database. 
                    2 if the record was updated in the database. 
                    0 if storing was not necessary.


*Feature proposal 2: *

Take SQL table field default values into use in XXXRecord constructors. 
Generate XXXRecord field initialization from SQL table field default values.
Designer could enable or disable this default value generation by editing 
the code generation configuration XML file, e.g:
<configuration>
  <generator>
    <generate>
        <defaults>true</defaults>

With this functionality designer could have correct default values in 
XXXRecord instances even before storing them into db.


Example SQL

    create table Person (
        id integer generated by default as identity (start with 1) primary 
key,
        birth_year integer default 1950 not null,
        first_name varchar_ignorecase(255),
        last_name varchar_ignorecase(255),
        license varchar_ignorecase(255) unique, 
        sex_int integer default 0,
        version integer not null,
    ...
    );

This would yield

    class PersonRecord {
    public PersonRecord() {
        setBirthYear(1950);
        setSexInt(0);
    }

    }





*Feature proposal 3:*

When XXXRecord.setValue(Field,value) function is called record raises a 
field specific flag "isChanged" to indicate that field is changed and it 
must be stored in db during next XXXRecord.store()

Proposed functionality:

To add a function XXXRecord.setChanged(Field field, boolean isChanged) 
which sets the value true or false. This is needed e.g. when records are 
copied field by field to new  (e.g. extended class) records. Ofcourse 
reflection can be used to reset isChanged, but it is not very efficient way 
of doing it.



Cheers,

Jouni

Reply via email to