Wondering how to approach the following
Suppose I want to support both SQL and Oracle, using the same domain
model, and mapping files.
Mostly, this works out nicely, and the mapping files are generally
"dialect neutral".
But I can see one problem so far, where it isn't quite so, the case of
id generator types.
Consider the following hbm snippet
<id name="Col1" type="int" unsaved-value="0">
<column name="Col1"/>
<generator class="native">
<param name="sequence">axiom_seq_2</param>
</generator>
</id>
Here, i have used the native generator class, which gives me
identities with SQL and sequences with Oracle. I can further control
the sequence using params, which are only used with Oracle.
That kind of works, but there are a couple of problems and, what I
really want is to be able to use a generator element with
class="identity" for SQL and with class="seqhilo" and parameters for
Oracle.
Like, if each mapping element had a "dialect" attribute or something
that would cause the element to be ignored if the current dialect
doesn't match. Any thought given to that sort of thing ever?
Is there some other mapping approach that would let me do this? I'm
considering adding my own attribute to the XML and then filtering on
it when I add the resource file. Not ideal, but I don't see a better
way.
Suggestions?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.