Skip to content

Tag: spring-data-jpa

post data for foreign key in postman

this is my model class.There is foreign key from another table AssessmentProperties .now when iam posting the data with postman my data looks like this but my input should be looking like this can anyone say me what should i do for this? and by the way this is the controller for post method Answer Instead of …

Escape colon (‘:’) in custom h2 Query

So I am trying to write a custom query for h2 using its JSON_OBJECT function. JSON_OBJECT uses a format of JSON_OBJECT(key:value) so as a simple example in my Spring repository I am writing a query like @Query(value = “SELECT JSON_OBJECT(‘id’:1)”, nativeQuery = true) When executing tha…