NHibernate HBM Files - Assembly name is not well generated

Posts   
 
    
rodri_ogri
User
Posts: 22
Joined: 05-Nov-2010
# Posted on: 23-Nov-2010 23:54:30   

Hi,

I'm trying to generate NHibernate HBM files but when I take a look to the XML file, I see that the "Assembly" definition does not correspond to my model's namespace, instead, it lacks the "dots" of the namespace.

example:

this part goes like this: assembly="CompanySystemDataAccess.Model" when it is supposed to be: Company.System.DataAccess.Model

Can you tell me if it is correct?

When I try to build a session factory, It tells me that my hbm files were not found (They are marked as embeded resource).

Any clue?

regards Rodrigo

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 24-Nov-2010 09:54:33   

Which designer version (release date) are you using?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Nov-2010 09:59:13   

The assembly name is the name of the project + group name if you use grouping as separate projects. It indeed removes the dots. We'll look into it. The namespace you specify in the 'Root namespace' is not this name btw, that name is specified OK.

(edit) the issue is coming from a change we did post-release, which altered the behavior of a property on the generator object used to transform the meta-data. We did add a new property which produced the 'raw' name (with the . and other characters you might have in the name of the project) which should have been used in the templates instead, though we didn't update them with this property however. In general this isn't a problem, as most project names don't contain '.', but in your case, you run into the problem. We'll fix this a.s.a.p.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Nov-2010 14:23:13   

Fixed in next build.

The hbm templates should have the 'raw' alternative for assembly name, so: assembly="<%=_executingGenerator.ActiveSourceElementsContainerNameRaw%>.

instead of

assembly="<%=_executingGenerator.ActiveSourceElementsContainerName%>.

Frans Bouma | Lead developer LLBLGen Pro
rodri_ogri
User
Posts: 22
Joined: 05-Nov-2010
# Posted on: 24-Nov-2010 14:45:32   

Otis wrote:

Fixed in next build.

The hbm templates should have the 'raw' alternative for assembly name, so: assembly="<%=_executingGenerator.ActiveSourceElementsContainerNameRaw%>.

instead of

assembly="<%=_executingGenerator.ActiveSourceElementsContainerName%>.

Hi Otis, thanks for your help,

You say the next build will contain the fix, ummm.... when should I expect it?

regards

Rodrigo

rodri_ogri
User
Posts: 22
Joined: 05-Nov-2010
# Posted on: 24-Nov-2010 15:00:47   

Oh!... I got it XD

Could you tell me where should I make the changes into my template files?

rodri_ogri
User
Posts: 22
Joined: 05-Nov-2010
# Posted on: 24-Nov-2010 16:39:50   

Hi again just in case for those who don't know how to do it,

Open the following path:

[INSTALLATION_FOLDER]\Solutions Design\LLBLGen Pro v3.0\Frameworks\NHibernate\Templates\Shared\Shared

Open the file: "entityHbmMapping.lpt"

[Sugested] Make a copy of it before making any changes

For my current version, Version 3.0, on line 29, change the value:

from:


assembly="<%=_executingGenerator.ActiveSourceElementsContainerName%>.

to:


assembly="<%=_executingGenerator.ActiveSourceElementsContainerNameRaw%>.Model"

as Otis said

Best regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Nov-2010 17:03:06   

Indeed simple_smile

Frans Bouma | Lead developer LLBLGen Pro