Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-19427

Redundant warning for JPA entity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.3.x
    • 4.3.0.Alpha2
    • hibernate
    • None
    • -

      Student entity is defined as:

      @Entity
      @XmlRootElement
      @NamedQuery(name="findAllStudents", query="select s from Student s")
      public class Student implements Serializable {
      

      Persistence.xml is defined as:

      <?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="HelloJavaEE7">
      		<properties>
      			<property name="javax.persistence.schema-generation.database.action"
      				value="drop-and-create" />
      			<property name="javax.persistence.schema-generation.create-source"
      				value="metadata" />
      			<property name="javax.persistence.schema-generation.drop-source"
      				value="metadata" />
      			<property name="hibernate.show_sql" value="true" />
      			<property name="hibernate.format_sql" value="true" />
      		</properties>
      	</persistence-unit>
      </persistence>
      

      Editor shows a red cross on Student class declaration with the error message "Class "org.sample.Student" is managed, but is not listed in the persistence.xml file".

      By default, all entities are included and this error should not occur.

            kaers@redhat.com Koen Aers
            arungupta_jira Arun Gupta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: