JPA connecting to wrong table
<p>I am trying to learn JPA
Here is my entity file.
Passenger.java</p>

<pre><code>@Entity

public class Passenger implements Serializable{
public Passenger() {
    super();
}

public int getId() {
    return id;
}

public void setId(int id) {
    this.id = id;
}

public String getFirstName() {
    return firstName;
}

public void setFirstName(String firstName) {
    this.firstName = firstName;
}

public String getLastName() {
    return lastName;
}

public void setLastName(String lastName) {
    this.lastName = lastName;
}


@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String firstName;
private String lastName;

}
</code></pre>

<p>My persistence.xml is below.</p>

<pre><code>&lt;persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" version="2.1"&gt;
 &lt;persistence-unit name="JPA_POJO"&gt;
     &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
    &lt;jta-data-source&gt;java:/airlines&lt;/jta-data-source&gt;
    &lt;class&gt;com.airline.model.Passenger&lt;/class&gt;
&lt;/persistence-unit&gt;
</code></pre>

<p></p>

<p>My servlet is like this.</p>

<pre><code>@WebServlet(name = "addPassenger")
public class addPassenger extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Passenger p = new Passenger();
//        airline p = new airline();

    p.setFirstName("ABC");
    p.setLastName("XYZ");

    EntityManagerFactory emf =       Persistence.createEntityManagerFactory("JPA_POJO");
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    em.persist(p);
    em.getTransaction().commit();

}
</code></pre>

<p>}</p>

<p>When I run this code I get the following error. </p>

<blockquote>
  <p>org.eclipse.persistence.exceptions.DatabaseException
  Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'airline.passenger' doesn't exist
  Error Code: 1146
  Call: INSERT INTO PASSENGER (ID, FIRSTNAME, LASTNAME) VALUES (?, ?, ?)</p>
</blockquote>

<p>As far as I can understand it is trying to connect to PASSENGER table instead of AIRLINE table.
I have assigned the data source that points to airline table. In fact I wrote a class file airline.java basically same as Passenger.java, when I used airline.java object(commented out in code) in my servlet it worked.
What am I doing wrong?</p>