Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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
Question ajoutée par Maria Thomas , Tech Lead , J P Morgan Chase
Date de publication: 2014/06/28
Leela Vinod Sirigina
par Leela Vinod Sirigina , Senior Java Software Engineer , Iton Corporation FZCO

No without primary key it will not work.

Abdulkareem Almahameed
par Abdulkareem Almahameed , Technical Lead , Software Engineer , KONY

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

Mayank Rawat
par Mayank Rawat , Spark Developer , Iris software

No, Hibernate will not work without primary key.

Wasib Ali Khan
par 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
par 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

Yes it can work without primary key.

 

Mohammad Shoab Ansari Mohammad Shoab Ansari
par 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.

More Questions Like This