I am using Fluent NHibernate to map an Oracle database. It is a legacy database so I cant really change everything I want.
There is a GUID field, but the keys are still composite (I will change this as soon as I can so that the keys are not composite, but I cant do it right now). The GUID is a VARCHAR2 field with this layout: 551608b1-275d-49f6-9561-44d01aacf23f. The GUID is not added by a sequence in Oracle, but inserted from code (C# or VB.net)
Guid.NewGuid() I map the keys like this (VB.net):
With CompositeId() .KeyReference(Function(x) x.Well, "WellID") .KeyProperty(Function(x) x.GUID, "GUID") .KeyProperty(Function(x) x.SetDate, "SET_DATE") End With Or like this in C#
CompositeId() .KeyReference(x => x.Well, "WellID") .KeyProperty(x => x.GUID, "GUID") .KeyProperty(x => x.SetDate, "SET_DATE"); The mapping work great, and the object are just as I want them, until I need to save.
When I try to save or update a unchanged object
m_Session.SaveOrUpdate(obj) I get : ORA-02289: sequence does not exist
Is the problem that I dont use a sequence to generate my GUID? How can I overcome this?