Apply db function to column value

Posts   
 
    
birchoff
User
Posts: 10
Joined: 13-Dec-2008
# Posted on: 13-Dec-2008 23:32:44   

lets say I have a table with three columns

varchar datetime varbinary

is there a way to influence llblgen pro so that the resulting INSERT,UPDATE,DELETE, SELECT queries would apply a function to a particular column all the time.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Dec-2008 09:39:35   

Please elaborate more. Could you give us an example? LLBLGen version?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39624
Joined: 17-Aug-2003
# Posted on: 14-Dec-2008 12:53:00   

I think it's related to the encryption/decryption of a column. At the moment this isn't supported. You can manipulate the queries after they're being generated, see the encryption/decryption thread of yours.

it's inserts which don't execute a function btw, updates do emit expressions (e.g. DbFunctionCalls) to the query. Inserts could obey this perhaps but it requires some changes in the DataAccessAdapter class and the SqlServer DQE (DynamicQueryEngine.cs, line 450-520). It might not be a big change, so we could look into altering the DQE a bit to make this work for you. (selects, updates already obey expressions set to fields. You need to set these expressions in an override to OnInitialized in a partial class of the entity).

But if you will use procs for CUD anyway, it's of course not worth the effort from our part. Should be look into this for you? (With expressions we mean DbFunctionCall instances for example.). If yes, please give us a full query in SQL (INSERT/UDPATE) how you want to use this, so I can see if it's possible to do (as the DbFunctionCall to emit in the INSERT's parameter list, is of course not getting info from the outside at query generation time. )

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39624
Joined: 17-Aug-2003
# Posted on: 15-Dec-2008 11:08:08   
Frans Bouma | Lead developer LLBLGen Pro