• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

table not mapped error when compiling entity bean

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I am getting the following error when trying to compile my code.

org.hibernate.hql.ast.QuerySyntaxException: Customer is not mapped [SELECT customer_number FROM Customer cusNum WHERE customer_Number = :customerNumber ]

here is my class.

@Entity
@Table(name = "CUSTOMER", uniqueConstraints = {})
@NamedQueries( { @NamedQuery(name = CustNumbInUse.CUSTOMER, query = "SELECT cusNumIU "
+ "FROM Customer cusNumIU "
+ "WHERE customerNumber = :customerNumber ") })
public class Customer implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;
public static final String FIND_BY_CUST_NUMB = "findByCustomerNumber";

private String customerNumber;

/** default constructor */
public Customer() {
}

/** full constructor */
public Customer(String customerNumber) {
this.customerNumber = customerNumber;

}

@Id
@Column(name = "CUSTOMER_NUMBER", unique = true, nullable = false, insertable = true, updatable = true, length = 24)
public String getCustomerNumber() {
return this.customerNumber;
}

public void setCustomerNumber(String customerNumber) {
this.customerNumber = customerNumber;
}

}


persistence .xml



<persistence-unit name="CUST_PU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/CUST_DS</jta-data-source>
<class>com.cgi.bellinternetservices.customerreservation.Customer</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>


I have tried using the full qualified name of the class in the query but to no use. i still get the same error.

Your help on this is much appreciated.
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic