Re: [JBoss-user] Auto created relationship table name.
I think the table mapping xml tags are named diffrently and are in another structure then the one you supplied assuming you are running JBoss 3.0 something. Try replacing the relationships part in your jbosscmp-jdbc.xml with the following: relationships ejb-relation ejb-relation-nameClient-Acl/ejb-relation-name relation-table-mapping table-nameclient_acl/table-name /relation-table-mapping create-tablefalse/create-table remove-tablefalse/remove-table ejb-relationship-role ejb-relationship-role-nameclient-has-acls/ejb-relationship-role-name table-key-fields table-key-field field-nameid/field-name column-nameclient_id/column-name /table-key-field /table-key-fields /ejb-relationship-role ejb-relationship-role ejb-relationship-role-nameacl-has-clients/ejb-relationship-role-name table-key-fields table-key-field field-nameid/field-name column-nameacl_id/column-name /table-key-field /table-key-fields /ejb-relationship-role /ejb-relation /relationships /Christofer On Saturday 08 June 2002 03.02, you wrote: I left out the entity bean stuff as it is pretty long. Let me know if you see my problem or if you want to see other files. gary. ?xml version=1.0 encoding=UTF-8? !-- = -- !-- -- !-- Standard JBossCMP-JDBC Configuration -- !-- -- !-- = -- !-- $Id: jbosscmp-jdbc.xml,v 1.1 2002/04/07 06:22:31 gary Exp $ -- jbosscmp-jdbc defaults datasourcejava:/ISG_DS/datasource type-mappingPostgreSQL/type-mapping debugtrue/debug create-tablefalse/create-table remove-tablefalse/remove-table read-onlyfalse/read-only time-out300/time-out pk-constrainttrue/pk-constraint fk-constraintfalse/fk-constraint row-lockingfalse/row-locking select-for-updatefalse/select-for-update relation-mapping-styleforeign-key/relation-mapping-style read-ahead strategyon-load/strategy page-size1000/page-size eager-load-group*/eager-load-group /read-ahead list-cache-max1000/list-cache-max alias-header-prefixt/alias-header-prefix /defaults relationships ejb-relation ejb-relation-nameClient-Acl/ejb-relation-name table-mapping table-nameclient_acl/table-name create-tablefalse/create-table remove-tablefalse/remove-table ejb-relationship-role ejb-relationship-role-nameclient-has-acls/ejb-relationship-role-nam e table-key-fields table-key-field field-nameid/field-name column-nameclient_id/column-name /table-key-field /table-key-fields /ejb-relationship-role ejb-relationship-role ejb-relationship-role-nameacl-has-clients/ejb-relationship-role-nam e table-key-fields table-key-field field-nameid/field-name column-nameacl_id/column-name /table-key-field /table-key-fields /ejb-relationship-role /table-mapping /ejb-relation /relationships /jbosscmp-jdbc Arthur Wang wrote: please post your many-to-many relationship defination in jbosscmp-jdbc.xml. -Original Message- From: Gary S. Cuozzo [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 5:21 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Auto created relationship table name. This seems similar to the problem that I am seeing. I am not auto-creating the table, but instead have an existing table that I want to use. When I try to use my many-to-many
[JBoss-user] EJB QL Problem
When deploying an app with the following query Jboss throws an java.lang.NullPointerException at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.getJoinClause(SQLUtil.java:311) SELECT OBJECT(p) FROM productcategory AS c, IN (c.products) AS p WHERE p.id = ?1 The relation is many to many. The nullpointer exception is being thrown somewhere around where JBoss returns the lists of pkFields and fkFields for the where clause in the SQL. I'm sure i'm doing something stupid and it's probably way past bedtime, but has anybody else run into this problem? Thanks, Chris ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] CMP in PostgresSQL : inaccurate data mapping inJAWS?
This is due to an error in the Postgres Driver. As Jboss writes it as an Int but reads it as a boolean, it is written as a 1 or 0 but the driver only accepts t or T when getting the resultset back as boolean. An easy fix to this problem is to change the ResultSet.java file in package org.postgresql.jdbc2 in the Postgres jdbc driver so the function getBoolean(int columnIndex) reads as follows: public boolean getBoolean(int columnIndex) throws SQLException { String s = getString(columnIndex); if (s != null) { int c = s.charAt(0); return ((c == 't') || (c == 'T') || (c == '1')); } return false; // SQL NULL } Thus adding support for handling 0's and 1's as well as the postgres standard 't'. This works with the current jaws mapping. And if i recall correctly it doesnt work even if you try mapping jaws to use boolean without changing and recompiling the postgres jdbc driver. /christofer On 19 Jul 2001 05:04:35 -0700, nathan frund wrote: Hermann, I'm running PostgreSQL 7.1.2 with JBoss 2.2.2 with sucess of CMP beans creating tables upon deployment but I too have had difficulty with the Boolean datatype. I've gotten it to insert and update 1 for true and 0 for false but when the server (JBoss) is restarted it writes all boolean fields acted upon back to false. I haven't tried mapping the datatype in JAWS to bool yet, as I'm working on other parts of the project. I may try today. If I works I'll be sure to let you know. --- Hermann RANGAMANA [EMAIL PROTECTED] wrote: Hi all, i'm currently using jBoss 2.2.1 and postgreSQL 7.0.1. I deploy my bean as CMP but when i try to create one, the database throws error back : ERROR: Attribute 'valide' is of type 'bool' but expression is of type 'int4' valide is a field in the bean : type boolean valide is also a column in the table with BOOLEAN type in standardjaws.xml data mapping of postgresSQL, i found this : mapping java-typejava.lang.Boolean/java-type jdbc-typeTINYINT/jdbc-type sql-typeINT2/sql-type /mapping that is jBoss maps java primitive type boolean into pgsql type int2, so value 'true' is inserted as 0 and value 'false'- i don't know. But it fails! Since pgsql has a 'BOOLEAN' type, why map java.lang.Boolean to INT2 instead of directly BOOLEAN? My guess is that, when jaws prepare the PreparedStatement for inserting a boolean value, it uses setInt () (because of type mapping to TINYINT) instead of setBoolean (). And then comes the exception Has anyone faced this problem ? Reguards. --hermann ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] CMP Postgres and Booleans
I had this problem aswell, and i belive that the postgres JDBC2 driver is to blame. A quick fix to the problem is to edit the ResultSet.java file in the Postgres driver source. Change the line: return ((c == 't') || (c == 'T')); int the getBoolean function on line 184:ish to: return ((c == 't') || (c == 'T') (c == '1')); This solved the problem for me... thank god for OpenSource. /christofer On 09 Apr 2001 12:00:14 -0700, Philip Craven wrote: I have a CMP bean that has a boolean variable. Before jboss is started, the value in the postgres database is 1 (true), after I start postgres and the bean is loaded, the value goes to false, and the database is updated to reflect this. What do I have misconfigured? __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user