Okay, here is the situation.

Database: Oracle on Solaris
Orion server: 1.5.2 on Windows 2000
Operating System: Windows 2000

I have a database table named FOO. I want to create different entity beans to
provide different views of the table named FOO. FOO is a table with many
columns. (Sure, I could create one entity bean, and then create "wrapper"
classes that provides the views of table FOO that I want, but I didn't want
to do that). Many of those column names contain underscores.

When I created the first CMP entity bean, I mapped all column names and used the

table name as the entity bean name. I wrote the appropriate ejb-jar.xml and
orion-ejb-jar.xml and packaged them. In the orion-ejb-jar.xml file, I used the
"persistence-name" to map the Java attribute to the proper table column. For all

attributes that mapped to a column name with an underscore, I removed the
underscore and uppercased the next character. (A column named long_col_name
would map to the attribute longColName).

So I deployed the entity bean and there were deployment errors. Orion complained

about illegal column names. Much later after going around in circles, I looked
at the ejb-jar.xml file that Orion generated and I noticed that the values for
the persistence-name mapped exactly to the column names of the database table.
It *IGNORED* what I had placed there. I had to edit the deployed xml file to get

the mapping correct and properly deployed.

Now, that's not very nice.

Next, I created another CMP entity bean to give a different view of table FOO. I

used the entity name FooTimeView and used the table attribute of
entity-deployment in the orion-ejb-jar.xml to map the entity to the FOO table. I

deployed it and, again, I got errors. I had to edit the deployed xml file to get

the correct mappings. I deployed again and it still failed. Only this time, it
tried to create a table named FOOTIMEVIEW. (Actually, it *DID* create the
table). That's not what I expected to happen. So, I looked at the deployed xml
file again and I noticed that the table name had been changed from what I
specified. This time, I also looked at the query that was generated and noticed

that the column names with underscores had the underscores removed.

Now, that's not very nice.

I edited that and restarted the server. Now all is well.

Okay, now I *KNOW* what I described should not happen. I want to know why it
did happen.

Has this happened to anyone else, or am I "special"?


Ed Brown


_________________________________________________________________________
This mail sent via toadmail.com, web e-mail @ ToadNet - want to go fast?
http://www.toadmail.com

Reply via email to