java - spring data rest with CrudRepository with @Embeddable -


i got following simplified entities:

@data @entity public class salesprocess {     private @id @generatedvalue long id;      @manytoone     private customer customer;      private date nextcontactdate;      private string nextcontactnote;      @embedded     @access(accesstype.property)     private actualproduct actualproduct;      private salesprocess() {} }   @data @embeddable public class actualproduct {      private string type;     private date manufacturedate;      private actualproduct() {} } 

this way have data bit separated though still in 1 table.

to rest endpoint create simple interface extending crudrepository:

public interface salesprocessrepository extends crudrepository<salesprocess, long> {} 

when request `http://localhost:8080/salesprocesses/1' correct response embedded type included that:

{   ...   actualproduct: {     type: 'some type',     ...   }, } 

my problem when try create new salesprocess executing post request server actualproduct embedded @ get response, every column embedded type null in database. rest endpoint returns 200.

funfact

i tried write custom controller , stored salesprocess salesprocessrepository. tested same query , works. dont know why spring-data-rest generated rest endpoint not store embedded type :(


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -