Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
如何设计实体关系来更好的实现跨级查询
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jason Ye  
View profile   Translate to Translated (View Original)
 More options Dec 5 2006, 4:52 am
From: "Jason Ye" <ycch...@gmail.com>
Date: Tue, 05 Dec 2006 09:52:37 -0000
Local: Tues, Dec 5 2006 4:52 am
Subject: 如何设计实体关系来更好的实现跨级查询
比如有Category、Product、Item三个实体,Category与Product之间,以及Product与Item之间都是1对多的关系。

如果我想直接查询某一个Category下面的所有Item,除了先返回Product[],再返回Item[],是否还有好的办法,可以减少实际产生的SQL 语句。


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Teddy  
View profile   Translate to Translated (View Original)
 More options Dec 5 2006, 6:36 am
From: Teddy <shijie...@gmail.com>
Date: Tue, 5 Dec 2006 19:36:49 +0800
Local: Tues, Dec 5 2006 6:36 am
Subject: Re: 如何设计实体关系来更好的实现跨级查询

没有特别方便的办法,不过,一般,复杂(关联)查选,建议用存储过程查询或直接用sql查询,将返回的结果填充到实体。

例如,可以使用Gateway.FindArray<Entity>(string sql, params object[]
paramValues)重载使用自定义sql查询返回Items,但是注意,自定义sql的select的列的顺序必须和Item的属性定义一致。

Teddy

On 12/5/06, Jason Ye <ycch...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google