title: JAVA SPRING rest app is receiving null in body
body: <p>I´m building an application with Postgree, JavaSpring and Angular. <code>GET</code> requests are working correctly and I can see the propper data in Angular, but when I <code>POST</code> any data, it is saying that all the fields from my Json are <code>NULL</code> when they arrive to Java´s application controller.  </p>
  
  <p>Is an obvious error in my code below?</p>
  
  <p>Java:</p>
  
  <pre><code>@RequestMapping(value = "/createEmployee", method = RequestMethod.POST)
      public void createEmployee(@RequestBody Employee emp) {
          EmployeeService.insertEmployee(emp);
      }
  </code></pre>
  
  <p>Angular:</p>
  
  <pre><code> async createNewUser( email, password, name, surname ) {
      let id : string;
      let body : Object;
      id = name[0] + surname[0] + (Date.now() + Math.floor((Math.random()*1000))).toString();
  
      body = new Object ( {
  
          "EmployeeEmail" :email,
          "EmployeePassword" :password,
         " EmployeeName" : name,
          "EmployeeSurname" : surname,
          "EmployeeId" : id
        });
  
  
     return await axios.post(this.apiUrl + 'createEmployee', body)
  </code></pre>
  
  <p>CLASS EMPLOYEE</p>
  
  <pre><code>      package com.sample.postgress.entity;
  
        import java.util.Date;
        import java.util.List;
  
        import javax.persistence.CascadeType;
        import javax.persistence.FetchType;
        import javax.persistence.JoinColumn;
        import javax.persistence.MapsId;
        import javax.persistence.OneToMany;
        import javax.persistence.OneToOne;
  
        import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  
  
         public class Employee extends UserPacman {
  
          @OneToOne(fetch = FetchType.LAZY, optional=false)
          @MapsId("UserPacmanId")
          @JoinColumn(name="UserPacmanId", nullable=false)
            UserPacman userpacman;
  
          @OneToMany(targetEntity = EmployeeProjectPeriod.class, 
            cascade=CascadeType.ALL)
          @JoinColumn(name="EmployeeId")
          @JsonIgnoreProperties("Employee")
          List&lt;EmployeeProjectPeriod&gt;EmployeeProjects;
  
          @OneToMany(targetEntity = Absence.class, cascade=CascadeType.ALL)
          @JoinColumn(name="EmployeeId")
          @JsonIgnoreProperties("Employee")
          List&lt;Absence&gt;EmployeeAbsence;
  
  
          @OneToMany(targetEntity = Skill.class, cascade=CascadeType.ALL)
          @JoinColumn(name="EmployeeId")
          @JsonIgnoreProperties("Employee")
  
  
  
         public int getHireData() {
         return hireData;
         }
  
  
         public void setHireData(int hireData) {
         this.hireData = hireData;
         }
  
  
         private int hireData ;
  
  
  
  
        }
  </code></pre>
  
  <p>CLASS USERPACMAN</p>
  
  <pre><code>     package com.sample.postgress.entity;
       import javax.persistence.CascadeType;
       import javax.persistence.Entity;
       import javax.persistence.OneToOne;
       import javax.persistence.Table;
  
  
       @Entity
       @Table
        public class UserPacman {
  
        String UserPacmanId;
        String UserPacmanName;
        String UserPacmanSurname;
        String UserPacmanEmail;
        String UserPacmanPassword;
  
         @OneToOne(mappedBy="UserPacman", cascade= CascadeType.ALL)
          Employee employee;
  
  
  
  
        public String getUserPacmanSurname() {
              return UserPacmanSurname;
            }
         public void setUserPacmanSurname(String UserPacmanSurname) {
      this.UserPacmanSurname = UserPacmanSurname;
      }
        public String getUserPacmanEmail() {
            return UserPacmanEmail;
       }
        public void setUserPacmanEmail(String UserPacmanEmail) {
          this.UserPacmanEmail = UserPacmanEmail;
        }
        public String getUserPacmanId() {
            return UserPacmanId;
         }
        public void setUserPacmanId(String UserPacmanId) {
          this.UserPacmanId = UserPacmanId;
         }
        public String getUserPacmanName() {
           return UserPacmanName;
         }
        public void setUserPacmanName(String UserPacmanName) {
           this.UserPacmanName = UserPacmanName;
        }
         public String getUserPacmanPassword() {
           return UserPacmanPassword;
         }
         public void setUserPacmanPassword(String UserPacmanPassword) {
           this.UserPacmanPassword = UserPacmanPassword;
         }
  
  
         }
  </code></pre>
  
  <p>APPLICATIONCONTROLLER</p>
  
  <pre><code>       package com.sample.postgress.controller;
  
         import java.util.List;
  
          import javax.annotation.Resource;
  
          import org.springframework.http.MediaType;
          import org.springframework.web.bind.annotation.CrossOrigin;
          import org.springframework.web.bind.annotation.DeleteMapping;
          import org.springframework.web.bind.annotation.GetMapping;
          import org.springframework.web.bind.annotation.PostMapping;
          import org.springframework.web.bind.annotation.PutMapping;
          import org.springframework.web.bind.annotation.RequestBody;
          import org.springframework.web.bind.annotation.RequestMapping;
          import org.springframework.web.bind.annotation.RequestMethod;
          import org.springframework.web.bind.annotation.RestController;
  
           import com.sample.postgress.entity.Absence;
           import com.sample.postgress.entity.Employee;
           import com.sample.postgress.entity.Project;
            import com.sample.postgress.entity.Skill;
          import com.sample.postgress.entity.UserPacman;
           import com.sample.postgress.service.AbsenceService;
            import com.sample.postgress.service.EmployeeService;
          import com.sample.postgress.service.ProjectService;
          import com.sample.postgress.service.SkillService;
          import com.sample.postgress.service.UserPacmanService;
  
  
          @RestController
          @RequestMapping("/postgressApp")
          @CrossOrigin(origins = "http://localhost:4200") 
  
          public class ApplicationController {
          @Resource
          SkillService SkillService;
          @Resource 
          ProjectService ProjectService;
          @Resource 
           EmployeeService EmployeeService;
          @Resource 
          UserPacmanService UserPacmanService;
          @Resource
          AbsenceService AbsenceService;
  
          @GetMapping(value = "/SkillList")
           public List&lt;Skill&gt; getSkill() {
               return SkillService.findAll();
  
           }
  
          @PostMapping(value = "/createSkill")
         public void createSkill(@RequestBody Skill  pro ) {
           SkillService.insertSkill(pro);
  
            }
            @PutMapping(value = "/updateSkill")
             public void updateSkill(@RequestBody Skill pro) {
             SkillService.updateSkill(pro);
  
            }
  
            @PutMapping(value = "/executeSkill")
             public void executeUpdateSkill(@RequestBody Skill pro) {
             SkillService.executeUpdateSkill(pro);
  
              }
  
  
             @GetMapping(value = "/EmployeeList")
               public List&lt;Employee&gt; getEmployee() {
             return EmployeeService.findAll();
  
              }
              @GetMapping(value = "/ProjectList")
               public List&lt;Project&gt; getProject() {
               return ProjectService.findAll();
  
               }
  
  
  
  
          @DeleteMapping(value = "/deleteProjectById")
           public void deleteProject(@RequestBody Project pro) {
            ProjectService.deleteProject(pro);
  
           }
  
  
          @RequestMapping(value = "/createEmployee", method = 
           RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
           public void createEmployee(@RequestBody Employee emp) {
           EmployeeService.insertEmployee(emp);
  
         }
  </code></pre>
  
  <p>Here is, in applicationController where it receives all the object´s fields null</p>