-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Error with mapping of C# type identificator
PostPosted: Fri Oct 08, 2010 9:58 am 
Newbie

Joined: Fri Oct 08, 2010 9:48 am
Posts: 1
There is some data access and entity classes and all of them have to base types. Entity classes are inherited from the following class:
Code:
public class PersistentObject<TId> : IPersistentObject<TId> where TId : struct
    {
        [DataMember]
        public virtual TId Id { get; set; }
...

The class which mapping I'm working on it the following one:
Code:
public class WatchList: PersistentObject
    {
        [DataMember]
        public virtual string Name { get; set; }
        [DataMember]
        public virtual User UserId { get; set; }
        [DataMember]
        public virtual WatchSecurity WatchSecurity{ get; set; }
    }

The error is something with this property Id which mapping is the following:
Code:
<class name="WatchList" lazy="true" table="[WatchList]">
    <id name="Id" type="int" unsaved-value="0">
      <column name="Id" sql-type="int" not-null="true" unique="true" />
      <generator class="identity" />
    </id>

Table&column names are correct and the exception details have no particular information about the problem with mapping, just a fraze that the problem is with mapping. I've tryed exclude this property and after it the exception dispears. But the property is required. Tell me please what errors can be with Id property mappping.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.