Hello. I've been having serious trouble with Nhibernate 2.1.0.4000 +
Fluent 1.0 + Oracle 10g.
Scenario:
There are legacy tables on another schema and the requirement is to
reference them on my domain.
There was no problem configuring the mappings. We managed to do so by
using custom sql types for Identity fields.
That seems to work ok but the problem arrives when trying to reference
(create FK) between my tables and theirs.
I give you an axample:
Legacy Table
FOO
(PK) codFoo: varchar2(4) -> Not the default that nhibernate uses.
Entity of my domain
FOOBAR
(PK) Id : number(20)
(FK) Foo : nvarchar(255) -> This is what nhibernates creates.
The problem is that as they are different types, oracle doesn't
support creating the FK.
Is there any workaround for this? If I upgrade to a greater version
will this be solved?
Mapping:
public class FooMap: classmap<Foo>
{
public FooMap()
{
table("Foo");
id(x => x.codFoo, "codFoo").CustomSqltype("varchar2(4)");
}
}
public class FooBarMap: classmap<FooBarMap>
{
public FooBarMap()
{
table("FooBar");
id(x => x.Id);
References(x=>x.Foo); <- Can't specify type here.
}
}
NOTE: The legacy schema is untochable and due to this thread
http://groups.google.com/group/nhusers/browse_thread/thread/7aa36dc69e60bfe1
I can't upgrade to 2.1.2.4000.
Thanks in advance for your support.
--
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.