db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Kromkamp <r.kromk...@pagelink.nl>
Subject RE: nullpointer BasePeer
Date Thu, 02 Jun 2005 08:41:15 GMT
Hi,

Below I added the relative tables from the schema.xml ....


<?xml version="1.0"?>
<!DOCTYPE database SYSTEM
"http://db.apache.org/torque/dtd/database_3_1.dtd">
<database name="opm" package="nl.pagelink.torque.opm"
defaultIdMethod="idbroker" baseClass="BaseObject" basePeer="BasePeer">
	<table name="ADRES" javaName="Adres" idMethod="none">
	    <column name="ADRES_ID" javaName="AdresId" javaType="object"
primaryKey="true" required="true" type="INTEGER" />
	    <column name="HUIS_NR" javaName="HuisNr" required="false"
type="VARCHAR" size="50" />
	    <column name="HUIS_NR_TOEV" javaName="HuisNrToev"
required="false" type="VARCHAR" size="5" />
	    <column name="HUIS_NR_AANDUIDING" javaName="HuisNrAanduiding"
required="false" type="VARCHAR" size="5" />
	    <column name="STRAATNAAM" javaName="Straatnaam" required="false"
type="VARCHAR" size="255" />
	    <column name="POSTCODE" javaName="Postcode" required="false"
type="VARCHAR" size="8" />
	    <column name="PLAATS_ID" javaName="PlaatsId" javaType="object"
required="true" type="INTEGER" />
		
		<foreign-key foreignTable="PLAATS" onUpdate="none"
onDelete="cascade">
			<reference local="PLAATS_ID" foreign="PLAATS_ID"/>
		</foreign-key>
		
		<index name="ADRES_PLAATS_ID">
			<index-column name="PLAATS_ID"/>
		</index>
	</table>
		
	<table name="OBJECTEN" javaName="Objecten" idMethod="none">
	    <column name="OBJECT_ID" javaName="ObjectId" javaType="object"
required="true" type="INTEGER" primaryKey="true"/>
	    <column name="NAAM_OBJECT" javaName="NaamObject"
required="false" type="VARCHAR" size="50" />
	    <column name="X_COORDINAAT_ADRES" javaName="XCoordinaatAdres"
javaType="object" required="false" type="INTEGER" />
	    <column name="Y_COORDINAAT_ADRES" javaName="YCoordinaatAdres"
javaType="object" required="false" type="INTEGER" />
	    <column name="Z_COORDINAAT_ADRES" javaName="ZCoordinaatAdres"
javaType="object" required="false" type="INTEGER" />
	</table>
	
	<table name="OBJECT_ADRES" javaName="ObjectAdres" idMethod="none">
	    <column name="OBJECT_ADRES_ID" javaName="ObjectAdresId"
javaType="object" primaryKey="true" required="true" type="INTEGER" />
	    <column name="OBJECT_ID" javaName="ObjectId" javaType="object"
required="true" type="INTEGER" />
	    <column name="ADRES_ID" javaName="AdresId" javaType="object"
required="true" type="INTEGER" />
		<foreign-key foreignTable="OBJECTEN" onUpdate="none"
onDelete="cascade">
			<reference local="OBJECT_ID" foreign="OBJECT_ID"/>
		</foreign-key>

		<foreign-key foreignTable="ADRES" onUpdate="none"
onDelete="cascade">
			<reference local="ADRES_ID" foreign="ADRES_ID"/>
		</foreign-key>

		<index name="OBJECT_ADRES_OBJECT_ID">
			<index-column name="OBJECT_ID"/>
		</index>

		<index name="OBJECT_ADRES_ADRES_ID">
			<index-column name="ADRES_ID"/>
		</index>
	</table>
	
</database>


Regards,
Robert
-----Original Message-----
From: Thomas Fischer [mailto:fischer@seitenbau.net]
Sent: dinsdag 31 mei 2005 9:05
To: Apache Torque Users List
Subject: RE: nullpointer BasePeer






Hi,

Is the table you want to use for joining (Adres) in your schema.xml ?

If not, you have to put it in there (this means you have to edit the db
scripts manually in order not to create and drop that table automatically,
but that is the price to pay)

If yes, which Torque version are you using and which is the exact code you
use to do the join ?

       Thomas

Robert Kromkamp <r.kromkamp@pagelink.nl> schrieb am 30.05.2005 14:50:04:

> Hi all,
>
> I'm trying to do a query with an order by on a foreign table.
> A foreign table means another table than the one on which the doSelect is
> executed. By example:
>
> Get a person (PersonPeer executes the doSelect query) and order by
Zipcode
> (Adres is the foreign orderby table)
>
> When i execute this i will get an error in BasePeer.java on line 1148:
>
> ColumnMap column = dbMap.getTable(table).getColumn(columnName);
>
> The adres table is not part a the dbMap (the Person table is part of it).
> Is this a bug, do I do something wrong or does anyone have a solution?
>
> Cheers,
> Robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message