WaYdotNET Web Blogs

Il blog di Carlo Bertini e qualcosa di .NET
posts - 57, comments - 2796, trackbacks - 925

My Links

News

Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

ASP.NET

Caxxate

How to Generate NHibernate Configuration Using ActiveWriter

Preview 3 has this functionality, but there are a few things to mention.
ActiveWriter use ActiveRecord assembly to generate NHibernate config files. So you'll need Castle.ActiveRecord.dll, NHibernate.dll and all necessary dependincies to make it work.

  1. Set the target to NHibernate
    This way, AW will generate .hbm.xml files for each entity in your model.
  2. Set the Assembly Path to where Castle.ActiveRecord.dll, NHibernate.dll and all necessary dependincies reside.
    The design decision was that, I didn't want to package these assemblies with AW. Rather than that, I thought user will most probably have them so they can choose whatever version they want to generate the configuration. If you don't supply the path, AW (VS, actually) will look for them in GAc and then {Your VS Path}\Common7\IDE\Castle.ActiveRecord.dll, so if you have them in one of those places, it should be fine.
    One other quirk is, if you first try to generate with the wrong path, setti ng the correct one later won't work until you restart Visual Studio. This is the framework's limitation, once you try to load an assembly and get an error, the result will be cached for subsequent tries. So VS appdomain should be restarted to make it work. I'll have a possible soliton for this for a future version of ActiveWriter (will try to load in a dummy appdomain, then in the VS appdomain)
    You may use the fully qualified assembly names for Active Record Assembly Name and NHibernate Assembly Name to target a specific version in the GAC, if you have more than one in there.
  3. When you save the model, AW will generate configuration.

I'll prepare a better documentation in the wiki.
Have fun.
Update:
AW does not work with release version of Castle assemblies (RC2?) for NHibernate generation, it works with the trunk (or with recently compiled assemblies). You can use the latest bits from the build server: http://builds.castleproject.org/cruise/index.castle

 

 

FONTE :

 

http://altinoren.com/default.aspx

Print | posted on mercoledì 20 giugno 2007 17:16 |

Feedback

Gravatar

# re: How to Generate NHibernate Configuration Using ActiveWriter

Come dice Ale, l ho riportato solo x il fatto che penso sia utile ad altre persone, se l' ho avessi scritto io.....lasciamo perdere :D:D:D:D:D

Carlo
21/06/2007 11:42 | Carlo Bertini
Gravatar

# mxrekogh

mxrekogh
22/03/2008 10:55 | mxrekogh
Gravatar

# alendronate

alendronate
24/03/2008 12:35 | alendronate
Gravatar

# kenalog

kenalog
25/03/2008 00:22 | kenalog
Gravatar

# naproxen

naproxen
25/03/2008 01:39 | naproxen
Gravatar

# nexium

nexium
25/03/2008 02:44 | nexium
Gravatar

# hoodia

hoodia
25/03/2008 07:30 | hoodia
Gravatar

# citalopram

citalopram
25/03/2008 07:30 | citalopram
Gravatar

# lisinopril

lisinopril
25/03/2008 13:03 | lisinopril
Gravatar

# motrin

motrin
25/03/2008 15:09 | motrin
Gravatar

# simvastatin

simvastatin
25/03/2008 15:10 | simvastatin
Gravatar

# arqidply

arqidply
25/03/2008 22:14 | arqidply
Gravatar

# furosemide

furosemide
26/03/2008 05:19 | furosemide
Gravatar

# danazol

danazol
26/03/2008 05:20 | danazol
Gravatar

# zopiclone

zopiclone
26/03/2008 05:20 | zopiclone
Gravatar

# prednisone

prednisone
26/03/2008 06:28 | prednisone
Gravatar

# fosamax

fosamax
26/03/2008 06:28 | fosamax
Gravatar

# effexor

effexor
26/03/2008 10:24 | effexor
Gravatar

# norvasc

norvasc
26/03/2008 19:37 | norvasc
Gravatar

# generic zoloft

generic zoloft
26/03/2008 22:48 | generic zoloft
Gravatar

# advil

advil
26/03/2008 23:57 | advil
Gravatar

# generic plavix

generic plavix
27/03/2008 15:28 | generic plavix
Gravatar

# glucophage

glucophage
27/03/2008 16:40 | glucophage
Gravatar

# generic wellbutrin

generic wellbutrin
28/03/2008 07:57 | generic wellbutrin
Gravatar

# generic hydrocodone

generic hydrocodone
28/03/2008 18:08 | generic hydrocodone
Gravatar

# levaquin

levaquin
28/03/2008 20:35 | levaquin
Gravatar

# generic prilosec

generic prilosec
28/03/2008 20:36 | generic prilosec
Gravatar

# lasix

lasix
28/03/2008 23:11 | lasix
Gravatar

# wellbutrin

wellbutrin
29/03/2008 09:31 | wellbutrin
Gravatar

# trazodone

trazodone
29/03/2008 15:31 | trazodone
Gravatar

# lortab

lortab
29/03/2008 17:40 | lortab
Gravatar

# desyrel

desyrel
29/03/2008 19:04 | desyrel
Gravatar

# vuphrnao

vuphrnao
30/03/2008 09:39 | vuphrnao
Gravatar

# allopurinol

allopurinol
30/03/2008 15:09 | allopurinol
Gravatar

# neurontin

neurontin
30/03/2008 15:10 | neurontin
Gravatar

# sdpchifo

sdpchifo
30/03/2008 22:22 | sdpchifo
Gravatar

# zocor

zocor
31/03/2008 17:12 | zocor
Gravatar

# lexapro

lexapro
31/03/2008 18:33 | lexapro
Gravatar

# zyban

zyban
01/04/2008 13:53 | zyban
Gravatar

# sibutramine

sibutramine
01/04/2008 15:08 | sibutramine
Gravatar

# ibuprofen

ibuprofen
01/04/2008 18:45 | ibuprofen
Gravatar

# losartan

losartan
01/04/2008 19:59 | losartan
Gravatar

# zestril

zestril
01/04/2008 21:19 | zestril
Gravatar

# generic zocor

generic zocor
02/04/2008 02:49 | generic zocor
Gravatar

# wbgtcwpa

wbgtcwpa
02/04/2008 15:16 | wbgtcwpa
Gravatar

# generic finasteride

generic finasteride
07/04/2008 04:06 | generic finasteride
Gravatar

# omeprazole

omeprazole
07/04/2008 04:06 | omeprazole
Gravatar

# hinxgjhb

hinxgjhb
07/04/2008 10:42 | hinxgjhb
Gravatar

# imovane

imovane
08/04/2008 09:02 | imovane
Gravatar

# esgic

esgic
08/04/2008 16:28 | esgic
Gravatar

# generic nexium

generic nexium
09/04/2008 06:53 | generic nexium
Gravatar

# diflucan

diflucan
09/04/2008 08:05 | diflucan
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET