Re: nhibernate - id change



>> update TABLE
>> set ID = 'new_id' where ID = 'old_id'
>
> You just can't do that - Hibernate would get very confused about which
> object you were talking about.
>
> It sounds like you really need a different primary key, I'm afraid.
>
> (You could go behind Hibernate's back and just make the change directly
> to the database - it's not very nice though...)

i know.
but im affraid that im in the situation in which doing little behind
hibernate
and leave keys as their are right now will be less evil (less work).
after setting new key id in the database object but before saving to
database
i could execute query that will change just the primary key, and later
save whole db object. but it would not be nice :/

regards
roman



.



Relevant Pages

  • Re: [Hibernate] wechselnde Fehler bei Update
    ... >>Der Primary Key ist für neue Events 0. ... Hibernate kann also eigentlich ... Prev by Date: ... Next by Date: ...
    (de.comp.lang.java)
  • Re: MFC ODBC and MS access DB
    ... this night i try and now working on a simple database: ... Primary key like numeric (thx Frank), some settings on Access DB and ... Prev by Date: ...
    (microsoft.public.vc.database)
  • Database Design Problem with Hibernate Primary Key and Foreign Key
    ... I am a newbie to Hibernate. ... That was why i have a triple primary key in my ENROLLED table as ... I can't decleare both id and composite-id in Enrolled.hbm.xml. ... CREATE TABLE ENROLLED (EID INTEGER NOT NULL auto_increment PRIMARY ...
    (comp.lang.java.databases)
  • Re: [Hibernate] wechselnde Fehler bei Update
    ... >Der Primary Key ist für neue Events 0. ... Hibernate kann also eigentlich ... Prev by Date: ... Next by Date: ...
    (de.comp.lang.java)
  • How do I trouble shoot table relationships in Access?
    ... I am trying to set up a database that uses 15 tables, ... have verified that the data types are the same, ... primary key in the main table and no primary key at all. ... Prev by Date: ...
    (microsoft.public.access.modulesdaovba)