-->
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: Quickstart MappingException - one possible solution
PostPosted: Mon Mar 06, 2006 3:29 pm 
Beginner
Beginner

Joined: Mon Mar 06, 2006 2:19 pm
Posts: 42
Location: Belo Horizonte, Brazil
There is one thing that I didn't see here for helping this exception.

When you try: cfg.AddAssembly("NameOfYourAssembly");

You maybe can think: "What assembly? My assembly is my own project." Well, if you followed the quickstart you're right, your persistence classes are part of the project and are not in a separate dll. So you need to know what is the assembly name of your project. Look at the Project->Properties. There is a field called "Assembly name". Fill the *.hbm.xml files and cfg.AddAssembly with it.

e.g:

Project Assebly Name: MyProject (look at Project->Properties)

hbm.xml file:
<class name="Animals.Dog, MyProject" table="dog">

Here Animals is your namespace, Dog is your class and MyProject is your assembly.

code:
cfg.AddAssembly("MyProject");


This is basic but can help a beginner. There is a lot of other posts here discussing the same problem.

note: You can embed your *.hbm.xml files but I think you must not embed the app.config file[/b]


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.