Carlos Ferr�o wrote:

>       Hi List,
> 
>       Thank you for your help with my problem with tables. I changed the entity
> bean name to "auth" and it is working. I didn't know that the name of entity
> beans needed to be the same as my tables in my database. 

They don't _need_ to. That's just the default. See the JAWS sections of 
the online manual for information on how to map it to a different name.

> I was accessing my
> db with the following code in my session bean:
>       try {
>       listlogin_connection = getDBConnection("java:/comp/env/jdbc/library");
> //jndi namespace for db
>       listlogin_statement = listlogin_connection.prepareStatement("select
> login from auth");
>       listlogin_records = listlogin_statement.executeQuery();
>       while(listlogin_records.next()) {
>       ...//get values from fields
> 
> Although my session is CMP, I think this is a direct way to access my db and
> it should never use the entity bean. Why is it used anyway? 

Your entity isn't being used. The JBoss CMP implementation (JAWS) 
defaults to creating the tables for CMP beans and defaults to giving the 
tables the same name as the bean because that's as good a name as any in 
the lack of any more information. You can override this in jaws.xml, and 
you can tell jaws not to try to create tables. You can also map the 
fields to columns with different names if you wish. Take a look at the 
online manual at www.jboss.org, there's rather a large section on JAWS.

-danch


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to