Changing Types

Posts   
 
    
stef
User
Posts: 28
Joined: 14-Jun-2005
# Posted on: 18-Jul-2005 01:27:00   

Apologies if this has been raised previously...

I'm working with a legacy database and I unfortunately can't change the schema. One of the (many) quirks of this schema is that it uses char(1) columns to store boolean values as Y and N.

Is there any facility in LLBLGen that would allow me to change types between the database schema and the entity class?

If not, I'm guessing that I will either:

  1. subclass from the generated entity class and implement the required type mapping in a property to replace the generated one.
  2. perform the conversion in a view and generate an entity from this view.

Thanks, Stef

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 18-Jul-2005 09:08:22   

The ability to convert these to bool etc is planned for 1.0.2005.1, the upgrade currently in development.

Frans Bouma | Lead developer LLBLGen Pro
PhilD
User
Posts: 19
Joined: 23-Jun-2005
# Posted on: 18-Jul-2005 13:32:58   

Otis wrote:

The ability to convert these to bool etc is planned for 1.0.2005.1, the upgrade currently in development.

Cool. I take it this will include mapping bits and ints to bool? I have stopped using the BIT type because it is SQL server specific, but I often have columns like "Enabled TINYINT NOT NULL" and a check constraint ensuring Enabled is 0 or 1. It would be great to do

MyEntity.Enabled = True
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 18-Jul-2005 13:37:07   

You will be able to specify which db type + precision/scale has to be mapped on which .NET type. The conversion is done by an assembly you can also write yourself. It will have some performance penalty of course, but it gives code which is more portable and easier to work with.

Frans Bouma | Lead developer LLBLGen Pro
stef
User
Posts: 28
Joined: 14-Jun-2005
# Posted on: 21-Jul-2005 22:23:52   

Thanks Otis, Is there a feature list for the next release of LLBLGen and an anticipated release date available?

Cheers, Stef

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 21-Jul-2005 23:03:39   

The main 2 features added are: 1) full inheritance support, multiple entities to same table mapping, exclusion of fields in an entity 2) type converter support

and a set of small things

I hope to have a beta mid august.

Oh, and of course CF.NET support, but that's already in beta at the moment.

Frans Bouma | Lead developer LLBLGen Pro