Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Using SQL directly instead of predicates...
 

Pages: 1
LLBLGen Pro Runtime Framework
Using SQL directly instead of predicates...
Page:1/1 

  Print all messages in this thread  
Poster Message
MattWoberts
User



Location:
Lancaster, UK
Joined on:
08-Apr-2004 10:24:31
Posted:
497 posts
# Posted on: 01-Jun-2007 12:28:08.  
Hi,

Some developers at "my place" are SQL guru's, but know nothing or little about LLBLGen. They are asking me if it possible that they can specify a "where" clause as pure SQL, without using the predicate system.

I'm not saying this is something you should do, but is it possible?

Matt  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14618 posts
# Posted on: 01-Jun-2007 15:42:17.  
Have they checked the Native language filter construction feature?
(The ability to formulate filters using compact, native language constructs)

Instead of:
Code:
PredicateExpression.Add(new FieldCompareValuePredicate(OrderFields.EmployeeID, null, ComparisonOperator.Equal, 2));

    
You can do this:
Code:
PredicateExpression.Add(OrderFields.EmployeeID == 2);


This can be quite handy in many situations.

Also if something gets too complicated, they can fall back to stored procedures and or database views, and call/map then from LLBLGen Pro.



  Top
MattAdamson
User



Location:
Andover
Joined on:
16-Nov-2006 11:39:07
Posted:
254 posts
# Posted on: 02-Jun-2007 23:19:48.  
It would be great if someone could write a utility to parse ANSI SQL and generate corresponding generic LLBLGen code.

This would help those coming from a SQL back ground to quickly understand the corresponding object model LLBLGen provides to search the data to get the same results.

Any volunteers?
  Top
jmeckley
User



Location:
Harrisburg, PA, USA
Joined on:
05-Jul-2006 16:03:19
Posted:
403 posts
# Posted on: 03-Jun-2007 01:49:39.  
I can sympathize with your situation. I too came from a stored proc/sql scripting background and it took a while to adjust to predicates. however once it clicks (should only take a day or two of constant use) it's a great system. and with the provided overloads/shortcuts it almost feels like writing sql scripts.

here are some tips/hints that may help:
  • think of PredicateExpressions as a set of parentheses.
  • You can use & and | as and/or shortcuts with predicates which may help make sense when switching from scripting to OOP.
  • if you (or your team members) have any questions post of the forum and the any one of the great talents here on the forums will assist you.


Jason Meckley
Programmer
 
Top
JimHugh
User



Location:
Davis, CA
Joined on:
16-Nov-2005 14:32:25
Posted:
191 posts
# Posted on: 04-Jun-2007 23:42:25.  
This question has been asked before..

http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=6734&HighLight=1

Quote:
Create a derived class from Predicate and emit your SQL in an override of ToQueryText.
Jim Hughes  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.