From: abcolson <nu...@jb...> - 2004-05-31 20:12:09
|
Thanks for the feedback, guys. But I am not sure I understand your recommendations. anonymous wrote : Try removing or commenting the from your ejb-jar.xml to rule that out, since it isn't needed for findByPrimaryKey(). I think maybe all the words didn't come through. I am unclear on what exactly you suggest removing. anonymous wrote : I'm wondering why it's looking for a relation. That seems really odd since you didn't define any relationships. | I think this might be a slip in terminology. It appears to be either a PostgresQL message or a java message i.e. java.sql.SQLException: ERROR: Relation "question" does not exist BTW, when I create a view called "question" which is simply a "SELECT * FROM Questions" the table is mapped but then I get field mapping errors (makes sense if it is the same mapping pattern problem) anonymous wrote : I think the problem is the space in your Question Categories. This don't work, even in sql. I don't think this is the problem. PostgresQL seems to be case sensitive and translates everything you type in a sql statement to lowercase unless you put it in quotes. Same goes for spaces. So in PostgresQL, SELECT * FROM "Question Categories" works fine. At some point I need to investigate the quoting issue, but I can't do that as long as JBoss keeps looking for "question" and not "questions". anonymous wrote : Your bean abstract schema name is QuestionCategory not QuestionCategorybean. | It's surprising you have no errors at deployment. | Do you mean QuestionCategoryBean (upper case B)? Actually, I am using XDoclet to generate the descriptors and this is what it generates by default. Do I really need to alter this? I am actually confused on what <abstract-schema-name> is used for so I can't comment on the issue of no deployment errors regarding abstract schema names. I did try changing the schema in my Question example to QuestionBean and that didn't seem to help. Here are the XDoclet headers for my 2 cases: QuestionBean: /** | * @author colson | * | * @ejb.bean name="Question" | * display-name = "Question EJB" | * description = "EJB that manages a Question" | * view-type = "remote" | * jndi-name = "ejb/tutorial/Question" | * cmp-version = "2.x" | * primkey-field = "id" | * | * @ejb.persistence table-name = "Questions" | * | * @ejb.finder description = "Lookup Question By ID" | * signature = "tutorial.interfaces.Question findByPrimaryKey(java.lang.Long)" | * result-type-mapping = "Local" | * query = "SELECT OBJECT(qb) FROM QuestionBean qb WHERE qb.id = ?1" | * | * @ejb.resource-ref res-ref-name = "jdbc/PostgresDS" | * res-type = "javax.sql.DataSource" | * res-auth = "Container" | * | * @jboss.resource-ref res-ref-name = "jdbc/PostgresDS" | * jndi-name = "java:/PostgresDS" | * | * @jboss.persistence table-name = "Questions" | * datasource = "java:/PostgresDS" | * | * To change the template for this generated type comment go to | * Window>Preferences>Java>Code Generation>Code and Comments | */ | QuestionCategoryBean: /** | * @author colson | * | * | * @ejb.bean name="QuestionCategory" | * display-name = "Question Category EJB" | * description = "EJB that manages a Question Category" | * view-type = "remote" | * jndi-name = "ejb/tutorial/QuestionCategory" | * cmp-version = "2.x" | * primkey-field = "id" | * | * @ejb.persistence table-name = "Question Categories" | * | * | * | * @ejb.finder description = "Lookup Question Category By ID" | * signature = "tutorial.interfaces.QuestionCategory findByPrimaryKey(java.lang.Long)" | * result-type-mapping = "Local" | * query = "SELECT OBJECT(qcb) FROM QuestionCategoryBean qcb WHERE qcb.id = ?1" | * | * @ejb.resource-ref res-ref-name = "jdbc/PostgresDS" | * res-type = "javax.sql.DataSource" | * res-auth = "Container" | * | * @jboss.resource-ref res-ref-name = "jdbc/PostgresDS" | * jndi-name = "java:/PostgresDS" | * | * | * | * To change the template for this generated type comment go to | * Window>Preferences>Java>Code Generation>Code and Comments | */ | Thanks for all the tips! Tony View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3836999#3836999 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3836999 |