Re: How to use Version Property in Hibernate or Nhibernate

From: Michael Borgwardt (brazil_at_brazils-animeland.de)
Date: 11/25/04


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.



Relevant Pages

  • Re: What is that question (?) sign after a type declaration?
    ... and have been wondering what is the function or meaning of that question ... sign after the member type name. ... in your example, _creationdate can be either a DateTime, or null. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: comparing datetime with date
    ... >>datetime and date are different by implementation, not by meaning. ... >>are time intervals. ... > Neither of them is - they are discrete points in time, ...
    (comp.lang.python)
  • How to use Version Property in Hibernate or Nhibernate
    ... Update_DT DateTime not null ... I want to use Hibernate to get data from this table by a simple ... which have the similar meaning. ... How can I use Session.Load() to load the latest record into Object? ...
    (comp.lang.java.programmer)
  • How to use Version Property in Hibernate or Nhibernate
    ... Update_DT DateTime not null ... I want to use Hibernate to get data from this table by a simple ... which have the similar meaning. ... How can I use Session.Load() to load the latest record into Object? ...
    (comp.lang.java.databases)