Is it possible to creat a partial entity that can be saved

Posts   
 
    
TaLz
User
Posts: 12
Joined: 26-May-2009
# Posted on: 03-Jun-2009 15:20:13   

hello, we have an entity that reflects a very large table. we want to reveal only certain fields from this table and enable to insert a new record with these fields. is there any way to do this in llblgen?? Is it possible to creat a partial entity that can be saved?

there is an option for typed lists...where you can drag some of the fields but this is no good for saving.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Jun-2009 15:38:54   

You can map an entity to a database table,and select which fields that should be mapped into the entity and thus exposed.

In other words you can remove selected fields from being mapped into the entity class.

arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 03-Jun-2009 16:46:45   

remember that in the database the fields that are not supplied must be nullable or have a database default value.

TaLz
User
Posts: 12
Joined: 26-May-2009
# Posted on: 04-Jun-2009 21:36:25   

Walaa wrote:

You can map an entity to a database table,and select which fields that should be mapped into the entity and thus exposed.

In other words you can remove selected fields from being mapped into the entity class.

this i know...but it does not enable me to create 2 partial entities that are mapped to the same table. i'll give u an example: i want an entity of type person and an entity of type organization. they are kept in the same table in the database...however person has a couple of more fields such as lastname and marriage status and number of children.

i would like to create a person entity and an organization entity. i don't think data base decisions should have to be reflected in the application.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 04-Jun-2009 22:47:26   

The designer will let you create multiple entities mapped to the same table, each with different names and different fields exposed.

I have to say that having organisations and people stored in the same table sounds like a fairly ugly bit of DB design - if they are different things with different properties, they should be in different tables simple_smile

Matt