Kev zam pov tseg thaum qhov kev txiav txim yuav ua txhaum txoj cai txwv ntawm qhov chaw cia khoom. Piv txwv li, thaum muaj kev sim ua kom tsis tu ncua ntxiv ib yam khoom mus rau ib qho uas yuav ua txhaum cov node node hom. Tsim ib qho piv txwv tshiab ntawm chav kawm no nrog null raws li nws cov lus nthuav dav.
Dab tsi yog kev txwv tsis pub nkag rau hauv hibernate?
hibernate. kev zam. ConstraintViolationException. Qhov no yog los ntawm qhov tshwm sim ntau tshaj plaws ntawm DataIntegrityViolationException raug pov tseg - Hibernate ConstraintViolationException qhia tias kev ua haujlwm tau ua txhaum cov ntaub ntawv kev ntseeg siab.
Kev txwv kev txwv yog dab tsi?
Ib qho teeb meem uas qhia tau hais tias yog qhov tseeb, tseem tsis tau semantically thov tsis raug cai. Nws tsis tau txhais hais tias yuav siv rau qhov kawg-neeg siv tswv yim validation, tab sis rau cov neeg tsim khoom yooj yim. Txhua yam teeb meem txhaum cai tshwm sim hauv kev tsim khoom yuav tsum raug suav hais tias yog kab laum.
Kev ua txhaum cai txawv teb chaws yog dab tsi?
Txoj kev cuam tshuam txawv teb chaws tseem ceeb ua txhaum cai hauv kev txwv kev ncaj ncees. … Ua thaum muaj kev ntxig lossis hloov tshiab ntawm lub rooj tseem ceeb txawv teb chaws ua tiav yam tsis muaj nqi sib xws hauv cov lus tseem ceeb.
Yuav ua li cas yog tias qhov txwv tsis pub sau npe raug ua txhaum cai?
Txoj kev daws teeb meem uas tuaj yeem kho qhov ua txhaum cai yog tias ib qho kev ntxig ua txhaum ib qho ntawm qhov txwv, ces qhov kev txiav txim siab yog tsis lees txais cov haujlwm no. Kev tshem tawmkev ua haujlwm: Ntawm kev tshem tawm cov tuples hauv kev sib raug zoo, nws tsuas yog ua txhaum cai ntawm Kev Ncaj Ncees Kev Ncaj Ncees.