The code below was missing from the persistance unit. false <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="MyJPAAppPU" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>mymyjpaapp.entities.Staff</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/dbname?zeroDateTimeBehavior=convertToNull"/> <property name="javax.persistence.jdbc.password" value="xxxxx"/> <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/> <property name="javax.persistence.jdbc.user" value="xxxxx"/> </properties> </persistence-unit> </persistence>
Read More