Object equality in context of hibernate / webapp

后端 未结 5 708
孤城傲影
孤城傲影 2020-12-08 22:46

How do you handle object equality for java objects managed by hibernate? In the \'hibernate in action\' book they say that one should favor business keys over surrogate keys

5条回答
  •  遥遥无期
    2020-12-08 23:15

    Thanks for all your input. I decided to use surrogate keys and provide those right at object creation time. This way i stay clear of all that 'rarely' changing stuff and have something solid to base identity on. First tests look rather good.

    thank you all for your time. Unfortunately, i can only accept one answer as solution i will take Pascals, as he provided me with good reading ;)

    enjoy

提交回复
热议问题