You'll have to invent the wheel here because your car has square axles...
Essentially, each new version is a new persistent instance. You'll have to
take care of everything in the repository/dao.
Diego
On Mon, Sep 27, 2010 at 07:35, Will Holley <[email protected]> wrote:
> Hi all,
>
> I have an existing database table which cannot be changed that I would
> like to map to entities with nhibernate. The fun part is that the
> table needs to maintain previous versions of the entity that it maps
> to.
>
> The table schema looks like:
>
> id uniqueidentifier PRIMARY KEY, -- effectively the version id
> parentId uniqueidentifier, -- the unique identifier for the entity
> throughout its lifetime
> childId uniqueidentifier, -- reference to the next version of the
> entity if exists
> currentChildId uniqueidentifier, -- reference to the current version
> of the entity,
> activeStatus bit, -- 1 if this row is the current version, else 0
> ....
> <entity specific fields>
>
> When an entity is flushed to the database, we need to go an update
> these fields in the previous version (if it exists). Additionally, we
> would like to throw an exception if the previous version has already
> been updated - this sounds like a similar thing to the existing
> versioning support in nhibernate?
>
> There is no requirement for the business entity to reference childId
> or currentChildId - these are probably redundant fields but we have to
> store them anyway :-(
>
> If anybody can give me any pointers as to how to implement this kind
> of thing I would be grateful, as I don't want to re-invent the wheel
> if nhibernate already has support for some of this.
>
> Many thanks,
>
> Will
>
>
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
--
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.