Persistence of DateTime AngularJS x Java x MySQL

0

I created an application in our company to control the use of certain equipment in our Industry. The fact is that there was a need to control the date / time of a product entering and leaving a certain equipment.

My Architecture: Front: HTML + Angular JS / Back: Java (JPA / REST) + MySQL Bank

HTML code:

<div class="col-md-4"><label>Data Final</label>
    <input class="form-control" type="datetime-local" ng-model="lancamento.dataFinal" required>
</div>

In Java, I created the class launches with the attribute dataInicial ( private LocalDateTime dataInicial; ) and the get / sets ...

In the WildFly LOG it gives the message:

  

Error: Status: 400 Message:   com.fasterxml.jackson.databind.JsonMappingException: Can not   instantiate value of type [simple type, class java.time.LocalDateTime]   from String value ('2016-10-06T14: 22: 00ZZ'); no single-String   constructor / factory method at [Source:   io.undertow.servlet.spec.ServletInputStreamImpl@13718c2; line: 1,   column: 25] (through reference chain:   com.controqualidade.vo.Lancamentos ["initial data"])

I tried to use other date formats, convert everything to String to Java, and there instantiate a date object and play in the database, but no option was accepted. In MySQL the column type is as TIMESTAMP.

Attached follows the Front (HTML & Controller & Service) and Java% class of%.

    
asked by anonymous 20.10.2016 / 21:47

0 answers