New Posts New Posts RSS Feed: Adding aggregation columns dynamically to entities
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Adding aggregation columns dynamically to entities

 Post Reply Post Reply
Author
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Topic: Adding aggregation columns dynamically to entities
    Posted: 21-Feb-2012 at 12:54pm
Hi Thomas,
 
You can add custom properties to either your entity classes or to an "injected" base type. 
 
Here's some information on adding custom properties:  http://drc.ideablade.com/xwiki/bin/view/Documentation/model-partial-class-file
 
 
If you're using a Code First model you do need to decorate these custom properties with a NotMapped attribute, but for other model types there's nothing special you need to do to tell DevForce not to persist them.
 
Back to Top
Thomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Feb-2012
Posts: 23
Post Options Post Options   Quote Thomas Quote  Post ReplyReply Direct Link To This Post Posted: 21-Feb-2012 at 2:12am
I am trying to add a aggregated column to one of my entities and so this column should not get persisted or treated in any way by DevForce. I do this because I would like to show a column with all the invoices (seperated by a comma) in a table where the shipment info should be displayed (and this information should be possible to be edited) and the table should be generated automatically from the model (this works perfectly for entities).

I don't know if there is maybe some attribute that I could apply to my "table entity" so that I would only extend the base entity with these columns and the EntityManager knows that he has to treat this class like the base class or if I have to write some mapper code to create a base entity again and persist/work with this one.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down