NonUniqueDiscoveredSqlAliasException when two table has same column names

You need set the result alias.

SELECT it.id as itemid, nik.id as nikasaid FROM item it LEFT JOIN nikasa nik ON (it.id = nik.item_id)

If you run your query in SQL workbench you will find that the table name is same as id for two columns. Hibernate treats it as duplicated so an alias is required. Let us assume you have query:

SELECT it.id, nik.id FROM item it LEFT JOIN nikasa nik ON (it.id = nik.item_id)

Output of the column name on SQL workbench will be:

id | id |

which works correctly there. But for hibernate it needs unique column name. So you need to add alias in anyone of the column

SELECT it.id as it_id, nik.id FROM item it LEFT JOIN nikasa nik ON (it.id = nik.item_id)

or

SELECT it.id , nik.id as nik_id FROM item it LEFT JOIN nikasa nik ON (it.id = nik.item_id)

or giving both of the column an alias.