I am using eclipse on mandriva and SQL Anywhere 12. when I create the tables via JPA (part of JEE5), the Java Persistence API, the tables are created, what is good, but with the format : <user_name>.<table_name>, e.g. "olivier_dba.t_item", but I would like to have "t_item". I saw the logs, and the SQL orders don't mention the user_name : the error seems to come from SQL Anywhere. and it is not a whim from me, but I can't go ahead in my project since there are errors in the java files (because the entities are not found in the DB).
can you help me?
EDIT - some news : finally I think that the user is not added to the table, but the eclipse plugin (SQL explorer) add the name of the user at the beginning of the name of the table. in sybase central I found that the names of the tables are good.
the error in eclipse is : "schema 'dbo' cannot be resolved for table <the_table>.
If you do not specify a table owner when creating a table (e.g., "CREATE TABLE t_item( ..."), the default behavior is to assign the table to the creating user.
If you want the table to be owned by another user (i.e., in another namespace), you simply need to explicitly include the desired "creator" in the CREATE TABLE command -- for example "CREATE TABLE dbo.t_item( ..." will create a table named t_item within the dbo schema.
Just as an aside, this is a very clear difference between That Other Transact-SQL server and Sybase's product. Microsoft SQL databases default to creating tables in the dbo schema when no table owner is specified, while SQL Anywhere uses the (more rational, IMNSHO) convention of assigning ownership to the user who actually created it.
answered 17 Sep '11, 21:41