Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

table not mapped error when compiling entity bean  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

@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;


@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">
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.show_sql" value="true"/>

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.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!