开发者

NHibernate mapping

开发者 https://www.devze.com 2022-12-19 20:15 出处:网络
How to map this class? [Serializable] public class AgentSourceCounter { private int agentId; private IDictionary<int, int> sourceCounters;

How to map this class?

[Serializable]
public class AgentSourceCounter
{
    private int agentId;
    private IDictionary<int, int> sourceCounters;

    protected AgentSourceCounter()
    {
    }

    public AgentSourceCounter(int agentId, Dictionary<int, int> sourceCounters)
    {
        this.agentId = agentId;
        this.sourceCounters = 开发者_如何学CsourceCounters;
    }

    public virtual int AgentId
    {
        get { return agentId; }
        protected set { agentId = value; }
    }

    public virtual IDictionary<int, int> SourceCounters
    {
        get { return sourceCounters; }
        set { sourceCounters = value; }
    }
}

To this table:

agentId int;
sourceId int;
hitsCounter int;


you can make a .hbm file.

maybe the below link is suitable for you :

NHibernate Mapping

0

精彩评论

暂无评论...
验证码 换一张
取 消