Results 1 to 2 of 2
  1. #1
    Sajox is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default Servlets + JPA problem - error in annotation's "@Table"

    Hello,

    I have problem with entity file. Eclipse shows the error in the annotation @Table about "Table "component" cannot be resolved".
    What I may doing?

    My entity file:

    Java Code:
    @Entity
    @Table(name="component") // Here is error: "Table "component" cannot be resolved"
    public class ComponentEntity implements Serializable {
     
            @Id
            private int id;
            private String symbol;
            private String type;
            private static final long serialVersionUID = 1L;
     
            public int getId() {
                    return this.id;
            }
     
            public void setId(int id) {
                    this.id = id;
            }
            public String getSymbol() {
                    return this.symbol;
            }
     
            public void setSymbol(String symbol) {
                    this.symbol = symbol;
            }   
            public String getType() {
                    return this.type;
            }
     
            public void setType(String type) {
                    this.type = type;
            }
    }
    File persistance.xml
    XML Code:
    <?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="MyProject1">
                    <class>sj.entities.ComponentEntity</class>
            </persistence-unit>
    </persistence>
    Help friends.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Servlets + JPA problem - error in annotation's "@Table"

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2011, 05:41 PM
  2. Replies: 2
    Last Post: 11-06-2011, 05:40 PM
  3. Replies: 1
    Last Post: 10-22-2011, 06:50 AM
  4. Simple "if" statement problem....compiling error.
    By CYANiDE in forum New To Java
    Replies: 4
    Last Post: 10-14-2009, 10:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 08:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •