Hi Will.There is a wiki to correct/remove/changeTheTitle ;)
http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround.aspx

2008/12/15 Will Shaver <[email protected]>

>
>
> http://nhforge.org/blogs/nhibernate/archive/2008/12/15/customizing-schema-export-with-schema-action.aspx
>
> On Mon, Dec 15, 2008 at 3:45 PM, Will Shaver <[email protected]>
> wrote:
> > Committed -> Revision 3954, closing NH1661, NH 1274.
> >
> > schema-action="none|drop|export|update|validate|all"
> >
> > Tests are passing etc. The only part that I'm not certain about is
> > Joined subclasses and other tricky mapping situations. I haven't ever
> > used those so I didn't know how to test them correctly. If someone who
> > uses those and would like to not export them could take a look that
> > would be great. Otherwise, it works great for the Views that I was
> > mapping.
> >
> >  -Will
> >
> > On Mon, Dec 15, 2008 at 1:57 PM, Fabio Maulo <[email protected]>
> wrote:
> >> I'm sorry... my fault.
> >> "validate" is the right value for the new attribute.
> >>
> >> 2008/12/15 Will Shaver <[email protected]>
> >>>
> >>> Because the tool and the method are called 'validate' instead of
> >>> 'verify' I am going to go with 'validate' as the xml keyword.
> >>>
> >>>
> >>> On Mon, Dec 15, 2008 at 1:07 PM, Tuna Toksöz <[email protected]>
> wrote:
> >>> > Verify is a newly added tool. SchemaValidator is the name, in Tools
> >>> > namespace.
> >>> > And yes ValidateSchema is what is used in that.
> >>> >
> >>> > On Mon, Dec 15, 2008 at 11:04 PM, Will Shaver <[email protected]
> >
> >>> > wrote:
> >>> >>
> >>> >> Ok, am doing the work to switch this over now based on your
> feedback.
> >>> >>
> >>> >> Update, export and drop are easy to implement and I think I have
> those
> >>> >> done and working. I'm writing test cases to make sure.
> >>> >>
> >>> >> What do you mean by 'verify'? Do you mean Configuration.cs Like 1985
> >>> >> -> ValidateSchema?
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >> On Sat, Dec 13, 2008 at 4:26 AM, Fabio Maulo <[email protected]>
> >>> >> wrote:
> >>> >> > Related to this issue we have probably something else...
> >>> >> > Do someone can check if catalog+schema is well supported in each
> >>> >> > schema-action ?
> >>> >> > Thanks.
> >>> >> >
> >>> >> > 2008/12/13 Stephen Bohlen <[email protected]>
> >>> >> >>
> >>> >> >> I am inclined to agree with this suggestionl; I had the same
> thought
> >>> >> >> when
> >>> >> >> reading this thread: what about the rest of the other
> schema-related
> >>> >> >> ops?
> >>> >> >> It would be great if we had a more extensible approach to this
> (as
> >>> >> >> you
> >>> >> >> are
> >>> >> >> proposing here) that would also allow for easily adding support
> for
> >>> >> >> any
> >>> >> >> MORE
> >>> >> >> schema-related ops that might be introduced in the future too.
> >>> >> >>
> >>> >> >> BTW, I think it would be great to get something like this into NH
> --
> >>> >> >> the
> >>> >> >> awkwardness of handling mapped view during schema-gen has been a
> >>> >> >> nuisance I
> >>> >> >> have battled with on several projects (and we have dealt with it
> by
> >>> >> >> using
> >>> >> >> custom sql in the create/drop sections of the mappings but this
> >>> >> >> always
> >>> >> >> felt
> >>> >> >> like a hack).  This approach (Will's combined with Fabio's
> >>> >> >> suggestion)
> >>> >> >> seems
> >>> >> >> much more elegant.
> >>> >> >>
> >>> >> >> -Steve B.
> >>> >> >>
> >>> >> >> On Sat, Dec 13, 2008 at 6:26 AM, Fabio Maulo <
> [email protected]>
> >>> >> >> wrote:
> >>> >> >>>
> >>> >> >>> I Will.
> >>> >> >>> We have various tools involving the schema:
> >>> >> >>> - Export
> >>> >> >>> - Drop
> >>> >> >>> - Update
> >>> >> >>> - Verify
> >>> >> >>> What about something like the follow:
> >>> >> >>> <classe name="Something" schema-action="export, drop, update,
> >>> >> >>> verify">
> >>> >> >>> The schema-action attribute can work like the "cascade"
> attribute
> >>> >> >>> as a
> >>> >> >>> multiple choice.
> >>> >> >>> All possible values of schema-action will be: none, all, export,
> >>> >> >>> drop,
> >>> >> >>> update, verify
> >>> >> >>> Default value is : all
> >>> >> >>> Thought ?
> >>> >> >>>
> >>> >> >>> 2008/12/12 Will Shaver <[email protected]>
> >>> >> >>>>
> >>> >> >>>> A while back I asked about means to exclude a table from the
> >>> >> >>>> schema
> >>> >> >>>> export. As this wasn't possible, I've now added it to my
> version
> >>> >> >>>> of
> >>> >> >>>> the
> >>> >> >>>> trunk. Before I commit I wanted to run it by people. Currently
> I
> >>> >> >>>> have
> >>> >> >>>> it set
> >>> >> >>>> up as follows:
> >>> >> >>>>
> >>> >> >>>> Tables are included by default. (As before.)
> >>> >> >>>>
> >>> >> >>>> Tables mapped as:
> >>> >> >>>>
> >>> >> >>>> <
> >>> >> >>>>
> >>> >> >>>> class name="Products" exportable="false">
> >>> >> >>>>  ...
> >>> >> >>>>
> >>> >> >>>> Will not be published in either the 'Drop Table' or the 'Create
> >>> >> >>>> Table'
> >>> >> >>>> commands from the schema export tool. This solves Jira issue
> 1274.
> >>> >> >>>> I
> >>> >> >>>> have
> >>> >> >>>> this working including the modification to the
> >>> >> >>>> xsd/Hbm.generated.cs
> >>> >> >>>> files.
> >>> >> >>>> Is this an acceptable means of excluding certain classes from
> >>> >> >>>> export?
> >>> >> >>>> For
> >>> >> >>>> reference, the reason for doing this could include mapping
> Views,
> >>> >> >>>> tables
> >>> >> >>>> from a different project, tables with existing data to be
> >>> >> >>>> preserved
> >>> >> >>>> etc.
> >>> >> >>>>
> >>> >> >>>> Your .02c would be useful.
> >>> >> >>>>
> >>> >> >>>>  -Will
> >>> >> >>>
> >>> >> >>>
> >>> >> >>> --
> >>> >> >>> Fabio Maulo
> >>> >> >>
> >>> >> >
> >>> >> >
> >>> >> >
> >>> >> > --
> >>> >> > Fabio Maulo
> >>> >> >
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Tuna Toksöz
> >>> > http://tunatoksoz.com
> >>> >
> >>> > Typos included to enhance the readers attention!
> >>> >
> >>> >
> >>
> >>
> >>
> >> --
> >> Fabio Maulo
> >>
> >
>



-- 
Fabio Maulo

Reply via email to