I've found something interesting. When I save my entity,which gets its PK assigned by a trigger when inserting, and refetchAfterSave is true, the entity will not be refetched properly.
I've took a look on the generated SQL and I realized why is this happening.
The generated SQL:
Query: INSERT INTO "SMTAPP"."XF_TABULKY" ("TABULKA", "ENTITYNAZOV") VALUES (:Tabulka1, :Entitynazov2)
Parameter: :Tabulka1 : String. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: "xx".
Parameter: :Entitynazov2 : String. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: "xx".
SELECT "SMTAPP"."XF_TABULKY"."ID" AS "Id", "SMTAPP"."XF_TABULKY"."TABULKA" AS "Tabulka", "SMTAPP"."XF_TABULKY"."ORDERBY" AS "Orderby", "SMTAPP"."XF_TABULKY"."ENTITYNAZOV" AS "Entitynazov" FROM "SMTAPP"."XF_TABULKY" WHERE ( ( "SMTAPP"."XF_TABULKY"."ID" IS NULL))
Is there any solution for this situation ? We have this triggers setting PK thing all across our DB.