Re: How to use Version Property in Hibernate or Nhibernate
From: Michael Borgwardt (brazil_at_brazils-animeland.de)
Date: 11/25/04
- Next message: Andrew Thompson: "Re: Vector takes a lot memory"
- Previous message: orientphoebus: "How to use Version Property in Hibernate or Nhibernate"
- In reply to: orientphoebus: "How to use Version Property in Hibernate or Nhibernate"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Nov 2004 18:07:58 +0100
orientphoebus wrote:
> I have a table with columns like this:
> ----------------------------------------------
> Id number not null,
> Name VARCHAR2(100) not null,
> Update_DT DateTime not null
> ----------------------------------------------
> The Update_DT is used, so that the table can keep all the history
> versions of the data.
>
> I want to use Hibernate to get data from this table by a simple
> Session.Load(), but I'd like to get the latest version always.
>
> In the hbm.xml, I notice there are <version> and <vimestamp>
> properties, which have the similar meaning.
No, they have a completely different meaning. There are no different
versions of one data item in the DB. They only allow you to spot
concurrent updates while not requiring transactions to span user
interaction.
> How can I use Session.Load() to load the latest record into Object?
You'll have to do a query that asks for the row with the maximal
timestamp.
- Next message: Andrew Thompson: "Re: Vector takes a lot memory"
- Previous message: orientphoebus: "How to use Version Property in Hibernate or Nhibernate"
- In reply to: orientphoebus: "How to use Version Property in Hibernate or Nhibernate"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|