Hello!
In my copybook where I am writing interesting notes it is written:
To be an entity class must follow these rules:
1. class must be annotated with @Entity
2. class must contain primary key annotated by @Id
3. class must contain public or protected no-argument constructor
4. class annotated by @Entity must be top-level, class without implementing or extending something
5. entity class must be not final, must not contain final variable or methods.
Also it is written:
Persistence provider maps entity to table thanks to annotation.
Do you have persistence provider configured in persistence.xml. If not then look at my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="OlympicsPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/olympicsDS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/olympics?zeroDateTimeBehavior=convertToNull"/>
<property name="javax.persistence.jdbc.password" value="123456"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.user" value="root"/>
</properties>
</persistence-unit>
</persistence>