Error Org Hibernate Util Jdbcexceptionreporter Invalid Identifier
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Org.hibernate.exception.sqlgrammarexception: Ora-00904: Invalid Identifier
and policies of this site About Us Learn more about Stack Overflow ora 00904 invalid identifier hibernate annotation the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Caused By: Java.sql.sqlsyntaxerrorexception: Ora-00904: Invalid Identifier
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it java.sql.sqlsyntaxerrorexception ora-00904 invalid identifier hibernate only takes a minute: Sign up ORA-00904: : invalid identifier Issue with Hibernate Dependent objects program up vote 1 down vote favorite I am working on a simple hibernate dependent objects program using Oracle as my database. Here are my POJO classes: Person public class Person { private java.util.Date birthday; private Name name; private String key; ... getters & setters ora 00904 this_ id invalid identifier ... } Name public class Name { char initial; String first; String last; ... getters & setters ... } Hibernate mapping file: person.hbm.xml
Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.
your email account, it might take several minutes until you are allowed to https://hibernate.atlassian.net/browse/hhh-6326 actually create a new issue. Please be patient. Hibernate ORMHHH-6326Oracle10gDialect cause "ORA-00904 - Invalid Identifier" because of wrong ordering of ANSI joinsLog http://www.dba-oracle.com/t_ora_00904_string_invalid_identifier.htm in PrintExport XMLExport Word Details Type: Bug Status: Open Priority: Major Resolution: Unresolved Affects Version/s: 3.6.5 Fix Version/s: 6.0.0-legacy (disregard) Component/s: query-hql invalid identifier Labels: None Environment: Hibernate 3.6.5, Oracle Database 11g Bug Testcase Reminder (view): Bug reports should generally be accompanied by a test case! Last commented by a user?: true Description If you try to execute this simple query select e.lastName, e.department.deptName, e.title from Employee e using invalid identifier hibernate Oracle10gDialect you get this: Output Hibernate: select employee0_.lastName as col_0_0_, department1_.deptName as col_1_0_, employee0_.title_id as col_2_0_, title2_.id as id1_, title2_.description as descript2_1_ from Employee employee0_, Department department1_ inner join Title title2_ on employee0_.title_id=title2_.id where employee0_.dept_no=department1_.deptNo 15/06/2011 20:28:09,626 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 904, SQLState: 42000 15/06/2011 20:28:09,627 ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00904: "EMPLOYEE0_"."TITLE_ID": invalid identifier It seems hibernate ordering of ANSI JOIN blocks is wrong. The correct query shoul be: Correct query select employee0_.lastName as col_0_0_, department1_.deptName as col_1_0_, employee0_.title_id as col_2_0_, title2_.id as id1_, title2_.description as descript2_1_ from Employee employee0_ inner join Title title2_ on employee0_.title_id=title2_.id, Department department1_ where employee0_.dept_no=department1_.deptNo You get the same error using HQL or JPQL. These are the entities I used. Entities @Entity public class Employee implements java.io.Serializable { private int empNo; private String firstName; private String lastName; privat
SQL TuningSecurityOracle UNIXOracle LinuxMonitoringRemote supportRemote plansRemote servicesApplication Server ApplicationsOracle FormsOracle PortalApp UpgradesSQL ServerOracle ConceptsSoftware SupportRemote Support Development Implementation Consulting StaffConsulting PricesHelp Wanted! Oracle PostersOracle Books Oracle Scripts Ion Excel-DB Don Burleson Blog
ORA-00904: STRING: invalid identifier tips Oracle Error Tips by Burleson Consulting Question: I am running a SQL statement and I get a SQL*Plus error ORA-00904 invalid identifier. Answer: When ORA-00904 occurs, you must enter a valid column name as it is either missing or the one entered is invalid. The "invalid identifier" most common happens when you are referencing an invalid alias in a select statement. The Oracle docs note this on the ORA-00904 error: ORA-00904 string: invalid identifier Cause: The column name entered is either missing or invalid. Action: Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks. It may not be a reserved word. To avoid ORA-00904, column names cannot be a reserved word, and must contain these four criteria to be valid: begin with a letter be less than or equal to thirty characters consist only of alphanumeric and the special characters ($_#); other characters need double quotation marks around them Another important factor in correcting ORA-00904 is remembering to run catproc.sql You can also check your trace file to find the particular error which is causing the ORA-00