ID mapping type

Thread is closed for posting
3 posts, 0 answers
  1. marco
    marco avatar
    7 posts
    Member since:
    Apr 2010

    Posted 21 Apr 2010 Link to this post

    Hi have created the class

    category.id
    category.name

    i map the class to the table cateogires.

    the id in the table is a char(10)
    in the application i have this code:

    Category cat = new Category();
                cat.Id = "tel";
                cat.Name = "Teler";
                scope.Add(cat);
                scope.Transaction.Commit();

    in the db the orm not save the correct value for the id.
    it use a autoincrement.
  2. marco
    marco avatar
    7 posts
    Member since:
    Apr 2010

    Posted 21 Apr 2010 Link to this post

    if i submit 2 times the page that create a new categroy and save the category in the db i get this error.

    Instance of 'DomainLib.Category' with identity '1122624262-tel' already exists in the cache of the object scope.


    it is correct because i try to insert 2 times a category with the same id.
    but in the db i have no categoryes with id = "tel" 
    each row in the db table has a number as id. (50,51,52,53,54,55....)
    ( cat.Id = "tel"; )


  3. marco
    marco avatar
    7 posts
    Member since:
    Apr 2010

    Posted 21 Apr 2010 Link to this post

    Sorry, was a problem with oracle.
    Is all ok!

Back to Top