This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I want to get data from a table based on certain condition. For eg, if table1 is not empty then get complete data from table2 else get the data from table2 for which created_dt (let's say it's one of the columns in table2) is today's date. It's like following :
then execute query1
If I understand correctly, I think you are trying to evaluate condition at the database layer. Isn't the condition a part of business layer ? The job of the lowest layer of ORM must be to execute a query. Which query has to be executed must be decided at the business layer. In short, you can use count(*) to evaluate the ccondition and use the ORM to execute the query.
Tushar (SCJP 1.5)
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Executing SQL query based on certain condition