Also this wasnt happening in 3.2.3 but started happening when I upgraded to 3.2.5.
Also, we are using oracle 10g. Is there supposed to be a type mapping for this in standardjbosscmp-jdbc.xml?
Can you post the stacktrace for the query?
We don't have default mapping for 10g yet. You are welcome to contribute. Thanks.
I seem to be having similar issues on JBoss 3.2.4 and Oracle 9i. Try as I could, I couldn't figure out a way to restric the CMR alias names. Here;s the query being generated
SQL: SELECT ORGANIZATIONAL_UNIT.ORG_UNT_ID, ORGANIZATIONAL_UNIT.ORG_UNT_PAR_ID, ORGANIZATIONAL_UNIT_organizationalUnitParent.ORG_UNT_NM, ORGANIZATIONAL_UNIT_organizationalUnitParent.ORG_UNT_VOID_IND, ORGANIZATIONAL_UNIT_organizationalUnitParent.ORG_UNT_EFF_DT, ORGANIZATIONAL_UNIT_organizationalUnitParent.ORG_UNT_END_DT, ORGANIZATIONAL_UNIT ORGANIZATIONAL_UNIT, ORGANIZATIONAL_UNIT ORGANIZATIONAL_UNIT_organizationalUnitParent WHERE
I get a ORA-00972: identifier too long exception. How is the ORGANIZATIONAL_UNIT_organizationalUnitParent alias generated in JBoss ? How can I restrict it to 30 characters for Oracle ?
I found the source of the problem. Looks like this may be a bug in the JBoss Code itself..
Environment: JBoss 3.2.4, Oracle 9i
Scenario : Bean called OrganizationalUnitBean (table : ORGANIZATIONAL_UNIT) . This had two CMR's to itself - parent and child relationships e.g getOrganizationalUnitParent() and getOrganizationalUnitChild().
The generated alias name for the CMR's was something like ORGANIZATONAL_UNIT_organziationalUnitParent and this was more than the customary 30 character limitation.
The source of the problem seems to be :-
relationTableAlias = relationTable;
relatedTableAlias = relatedTable.equals(relationTable) ?
relationTable + '_' + cmrField.getFieldName() : relatedTable;
There is no truncating of the alias name here.. and that's causing the problems. Not sure if this needs to be rectified or maybe the design of the bean itself. For the time being, I have changed the method names to be getParent() for e.g..