-->
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.  [ 3 posts ] 
Author Message
 Post subject: cannot be specified as proxy
PostPosted: Tue May 30, 2006 5:24 am 
Newbie

Joined: Mon May 29, 2006 5:19 am
Posts: 4
SQL2k+VS2005

MyCode:
Code:
private void Form1_Load(object sender, EventArgs e)
        {
            Configuration cfg = new Configuration();
            cfg.AddAssembly("NHClass");
            ISessionFactory factory = cfg.BuildSessionFactory();


Error at line :cfg.BuildSessionFactory()

Error Message : Type 'NHClass.Post' cannot be specified as proxy: method get_PostID should be virtual

I'm sure I never setup any proxy.....

Class Post:
Code:
using System;
using System.Collections;

namespace NHClass

public class Post
    {...


Post.hbm.xml:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
    <class name="NHClass.Post, NHClass" table="nh_posts">
      <id name="PostID" column="PostID" type="Guid">
        <generator class="assigned" />
      </id>
...


Please!


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 6:07 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
if you do not want it to be a proxy, you should set (in the mapping file) : lazy="false" on the class definition.

The new default is for every class to be lazy. So you have to actively set it to false yourself.

I hope that helps.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 9:17 pm 
Newbie

Joined: Mon May 29, 2006 5:19 am
Posts: 4
That's Greate!!!!!

THANK YOU VERY VERY MUCH!!!!!!!!

IT’S WORK WELL!!!!!!!!


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

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.