ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Does hibernate work on tables which do not have a primary key?

How can we read or write data to a table which does not have a primary key using ORM frameworks?

user-image
تم إضافة السؤال من قبل Maria Thomas , Tech Lead , J P Morgan Chase
تاريخ النشر: 2014/06/28
Leela Vinod Sirigina
من قبل Leela Vinod Sirigina , Senior Java Software Engineer , Iton Corporation FZCO

No without primary key it will not work.

Abdulkareem Almahameed
من قبل Abdulkareem Almahameed , Technical Lead , Software Engineer , KONY

No, till today Hibernate doesn't support tables without primary key

Mayank Rawat
من قبل Mayank Rawat , Spark Developer , Iris software

No, Hibernate will not work without primary key.

Wasib Ali Khan
من قبل Wasib Ali Khan , Software Engineer , Emaratech FZ LLC

Every table  should have some unique key. The mathematical definition of a relation is a set of tuples.  Furthermore, truly identical rows can not possibly have any meaningful semantics from the user's perspective.In some cases it may be sensible to go as far as mapping all columns of a view as a composite-id, but there is almost always some smaller business key.

Mudassar Hakim
من قبل Mudassar Hakim , Requirement Analyst & Software Developer , L&T Infotech

The whole idea of hibernate maintaining unique objects within the session of the persistant context is via the primary key i.e. the Serializable key unless that table is a component table to the parent table

Mohammad Shoab Ansari Mohammad Shoab Ansari
من قبل Mohammad Shoab Ansari Mohammad Shoab Ansari , Software Developer , Asofttechnotech

Hibernate not work without primary key. Primary key is neccessary. if you not specify a primary key then by default create a primary key. if u delete manualy , hibernate does't work.

المزيد من الأسئلة المماثلة