在表中填充集合对象的两个不同对象

时间:2013-11-25 10:05:20

标签: sql sql-server

我有一个tweet和一个stream表。我将这两个表填充到feed类中,而不是使用一个feed表。问题是我没有填充FeedId的唯一StreamId / TweetId,它可以是相同的,我必须从FeedTypeId(推文,帖子或评论)中识别。我不确定我在做什么是正确的,我想得到一些意见,这些问题是如何得到更好的处理。

感谢您提前付出的努力。

表和Feed类>

鸣叫

[TweetId] [bigint] IDENTITY(1,1) NOT NULL,
[TweetType] [smallint] NULL,
[SocialPageId] [int] NULL,
[SearchId] [int] NULL,
[TweetId] [bigint] NULL,
[Text] [varchar](255) NULL,
[UserID] [bigint] NULL,
[Name] [varchar](50) NULL,
[ScreenName] [varchar](50) NULL,
[ProfileImageUrl] [varchar](255) NULL,
[IsFollowing] [bit] NULL,
[FollowersCount] [int] NULL,
[CreatedAt] [datetime] NULL,
[Created] [datetime] NULL,
[HasRead] [tinyint] NULL,
[IsRated] [tinyint] NULL,
[IsTasked] [tinyint] NULL,

[StreamId] [bigint] IDENTITY(1,1) NOT NULL,
[SocialPageId] [varchar](200) NULL,
[TypeId] [int] NULL,
[TypeName] [varchar](50) NULL,
[Text] [text] NULL,
[CreateDate] [datetime] NULL,
[FBId] [varchar](100) NULL,
[FBUserId] [varchar](100) NULL,
[FBUserName] [varchar](100) NULL,
[FBImageLink] [varchar](250) NULL,
[ParentId] [varchar](100) NULL,
[HasRead] [tinyint] NULL,
[IsRated] [tinyint] NULL,
[IsTasked] [tinyint] NULL,
[Gender] [smallint] NULL

public class Feed
{
    public string FeedId { get; set; }
    public int PageId { get; set; }
    public string FeedTypeId { get; set; }
    public string TypeName { get; set; }
    public string Text { get; set; }
    public DateTime CreateDate { get; set; }
    public string O_Id { get; set; }
    public string O_UserId { get; set; }
    public string O_UserName { get; set; }
    public string DisplayName { get; set; }
    public string O_ImageLink { get; set; }
    public string ParentId { get; set; }
    public int Retweet { get; set; }
    public int Favorite { get; set; }
    public int Like { get; set; }
    public int Share { get; set; }
    public int IsTasked { get; set; }
}

0 个答案:

没有答案