RE: AW: Joins and performance

2007-06-01 Thread Robert Kromkamp
Hi!

I found this link: 
http://www.mail-archive.com/torque-user@db.apache.org/msg03571.html 

Robert

-Original Message-
From: Alvaro Coronel [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 01, 2007 4:05 PM
To: Apache Torque Users List
Subject: Re: AW: Joins and performance

That sounds _very_ useful ! 

Robert, could you post the link if you find it?

Thanks in advance,
Álvaro.

"Vitzethum, Daniel" <[EMAIL PROTECTED]> wrote: Hi Robert,

> If I've 100 companies (which are schools) and 200 buildings, I will 
> executes 100 * 200 queries to get all the employees.

be sure to avoid this... sounds like a killer ;-)

> In low level SQL
> this query can be combined in one query. Is there a way to handle this 
> within Torque?

In Torque, you can use the Criteria.addJoin() method to link two tables.


Using that feature, you cannot use the Peer.doSelect() method, but have to use 
Peer.doSelectVillageRecords(), which will return all columns of all joined 
tables in a village Record object, with no big difference to plain JDBC in 
handling. If you need or want Torque data objects, you have to extract them one 
by one from the result set.

For a project of us, we wrote a helper class named JoinHelper that does this 
business for you AND returns an tree of Torque objects. In your case, it would 
return COMPANY objects that can be queried for their BUILDINGs, which again 
know their EMPLOYEEs.

Please search the thread about two years ago in Torque archive and the 
discussion about. JoinHelper massively uses reflection, but is tested quite 
well and in production. If you have more detailled questions...
you're welcome.


Daniel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



   
-
Need a vacation? Get great deals to amazing places on Yahoo! Travel. 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Joins and performance

2007-06-01 Thread Robert Kromkamp
Hi Greg,

Thanks for you reply! I've used views before within Torque. But in that
case I've problems with inserts/update statements. How do you handle
these?

Regards,
Robert
 

-Original Message-
From: Greg Monroe [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 01, 2007 4:15 PM
To: Apache Torque Users List
Subject: RE: Joins and performance

If this is a frequent/heavily used query, another way to deal with this
is to create a view and a matching Torque object.  There is a table
option that suppresses the SQL generation.  You can then just use the
Peer/Record object as like it was a normal table.

Note you may want to pay close attention to the indices requirements of
the underlying table.  If commonly used columns in a large join are not
index, it can be a BIG performance hit.

> -Original Message-
> From: Vitzethum, Daniel [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 01, 2007 9:40 AM
> To: Apache Torque Users List
> Subject: AW: Joins and performance
> 
> Hi Robert,
> 
> > If I've 100 companies (which are schools) and 200 buildings, I will 
> > executes 100 * 200 queries to get all the employees.
> 
> be sure to avoid this... sounds like a killer ;-)
> 
> > In low level SQL
> > this query can be combined in one query. Is there a way to handle 
> > this within Torque?
> 
> In Torque, you can use the Criteria.addJoin() method to link two 
> tables.
> 
> 
> Using that feature, you cannot use the Peer.doSelect() method, but 
> have to use Peer.doSelectVillageRecords(), which will return all 
> columns of all joined tables in a village Record object, with no big 
> difference to plain JDBC in handling. If you need or want Torque data 
> objects, you have to extract them one by one from the result set.
> 
> For a project of us, we wrote a helper class named JoinHelper that 
> does this business for you AND returns an tree of Torque objects. In 
> your case, it would return COMPANY objects that can be queried for 
> their BUILDINGs, which again know their EMPLOYEEs.
> 
> Please search the thread about two years ago in Torque archive and the

> discussion about. JoinHelper massively uses reflection, but is tested 
> quite well and in production. If you have more detailled questions...
> you're welcome.
> 
> 
> Daniel
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are
confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity to
whom they are addressed.  If you are not the intended recipient you may
not rely on the contents of this email or any attachments, and we ask
that you  please not read, copy or retransmit this communication, but
reply to the sender and destroy the email, its contents, and all copies
thereof immediately.  Any unauthorized dissemination, distribution or
copying of this communication is strictly prohibited.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Joins and performance

2007-06-01 Thread Robert Kromkamp
Hi Daniel,

That's exactly what I was looking for

Thanks for your reply! This is very usefull.

I found the discussion about the class you mentioned below. It's in:

http://www.mail-archive.com/torque-user@db.apache.org/msg03571.html


But I've the feeling this could be an old version casue still
Peer.doSelect is used instead of Peer.doSelectVillageRecords(). Is this
correct? Can you tell me where to find the newest version or perhaps
could you send it to me?

In some cases I use LargeSelect (with paging). Do have a same kind of
solution for handle such kind of queries?

Thanks,
Robert

-Original Message-
From: Vitzethum, Daniel [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 01, 2007 3:40 PM
To: Apache Torque Users List
Subject: AW: Joins and performance

Hi Robert,

> If I've 100 companies (which are schools) and 200 buildings, I will 
> executes 100 * 200 queries to get all the employees.

be sure to avoid this... sounds like a killer ;-)

> In low level SQL
> this query can be combined in one query. Is there a way to handle this

> within Torque?

In Torque, you can use the Criteria.addJoin() method to link two tables.


Using that feature, you cannot use the Peer.doSelect() method, but have
to use Peer.doSelectVillageRecords(), which will return all columns of
all joined tables in a village Record object, with no big difference to
plain JDBC in handling. If you need or want Torque data objects, you
have to extract them one by one from the result set.

For a project of us, we wrote a helper class named JoinHelper that does
this business for you AND returns an tree of Torque objects. In your
case, it would return COMPANY objects that can be queried for their
BUILDINGs, which again know their EMPLOYEEs.

Please search the thread about two years ago in Torque archive and the
discussion about. JoinHelper massively uses reflection, but is tested
quite well and in production. If you have more detailled questions...
you're welcome.


Daniel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Joins and performance

2007-06-01 Thread Robert Kromkamp
Hi All,

I've a question about joins. 

I've got 3 tables, namely:

- Company
- Company_building (Company has one ore more building)
- Employees (Employee works in one ore more building)

Getting all the companies will result in a low level SQL by Torque like:

SELECT  COMPANY.COMPANY_PK, COMPANY.COMPANY_NAME,
COMPANY.COMPANY_FUNCTION 
FROMCOMPANY 
WHERE   COMPANY.COMPANY_FUNCTION = 'SCHOOL'



To get all the buildings I will loop through all the companies and call
Company.getBuildings() this will result in:

SELECT  COMPANY_BUILDING.COMPANY_BUILDING_PK,
COMPANY_BUILDING.BUILDING_NAME, COMPANY_BUILDING.COMPANY_FK 
FROMCOMPANY_BUILDING 
WHERE   COMPANY_BUILDING.COMPANY_FK = 1

SELECT  COMPANY_BUILDING.COMPANY_BUILDING_PK,
COMPANY_BUILDING.BUILDING_NAME, COMPANY_BUILDING.COMPANY_FK 
FROMCOMPANY_BUILDING 
WHERE   COMPANY_BUILDING.COMPANY_FK = 2

SELECT  COMPANY_BUILDING.COMPANY_BUILDING_PK,
COMPANY_BUILDING.BUILDING_NAME, COMPANY_BUILDING.COMPANY_FK
FROMCOMPANY_BUILDING
WHERE   COMPANY_BUILDING.COMPANY_FK = 3

Etc.




To get all the employees I will loop in Java through all the building
and call CompanyBuilding.getEmployees() this will result in another
lowlevel query.



If I've 100 companies (which are schools) and 200 buildings, I will
executes 100 * 200 queries to get all the employees. In low level SQL
this query can be combined in one query. Is there a way to handle this
within Torque? So I will get something like:

SELECT  * 
FROMCOMPANY, COMPANY_BUILDING, EMPLOYEES 
WHERE   COMPANY.COMPANY_FUNCTION = 'SCHOOL'
AND COMPANY_BUILDING.COMPANY_FK = COMPANY.COMPANY_PK
AND EMPLOYEE.COMPANY_BUILDING_FK =
COMPANY_BUILDING.COMPANY_BUILDING_PK


I'm using Torque 3.1.1 (I will upgrade to the newest version very soon)

Many Thanks!

Met vriendelijke groet,
Robert Kromkamp



Pagelink | improves business

Bornsestraat 1d
7556 BA  Hengelo

Postbus 76
7550 AB  Hengelo

tel 074 750 12 50
fax 074 750 12 51

mailto:[EMAIL PROTECTED]
http://www.pagelink.nl
http://www.perrit.nl
http://www.armeo.nl











-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: no DataSourceFactory configured

2007-01-22 Thread Robert Kromkamp
Hi Pierre,

Everything seems to be ok! Is the torque.properties in your classpath?

Regards,
Robert

-Original Message-
From: Pierre-Alain Branger [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 20, 2007 2:04 AM
To: torque-user@db.apache.org
Subject: no DataSourceFactory configured

Hi everybody,

I follow the tutorial and could generate my mysql database and the 
corresponding java access classes. I made a jar and add it to a java project 
that compiled well. But when I launch my application I obtain the following 
message:

java.lang.NullPointerException: There was no DataSourceFactory configured for 
the connection BddPortalCCG
at
org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:711)
at org.apache.torque.Torque.getConnection(Torque.java:268)
at
org.apache.torque.util.Transaction.beginOptional(Transaction.java:80)
at org.apache.torque.util.Transaction.begin(Transaction.java:62)
at
mx.unam.ccg.BddPortal.BaseApplication.save(BaseApplication.java:361)
at
mx.unam.ccg.BddPortal.BaseApplication.save(BaseApplication.java:343)
at testbddportalccg.Main.main(Main.java:36)

I hope soñeone could help, me. Here are the different configuring files I
use:

- torque.properties 

torque.database.default = BddPortalCCG
torque.database.BddPortalCCG.adapter = mysql

# Using commons-dbcp
torque.dsfactory.BddPortalCCG.factory =
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
torque.dsfactory.BddPortalCCG.connection.driver = org.gjt.mm.mysql.Driver 
torque.dsfactory.BddPortalCCG.connection.url = 
jdbc:mysql://localhost:3306/BddPortalCCG
torque.dsfactory.BddPortalCCG.connection.user = 
torque.dsfactory.BddPortalCCG.connection.password =


- project.properties  # The name of the project 
Torque will generate code for.
torque.project=BddPortalCCG

# The target database platform.
torque.database=mysql

# The target package to put the generated classes in.
torque.targetPackage=mx.unam.ccg.BddPortal

# The JDBC URL that Torque can use to create and # drop databases if instructed 
to do so.
torque.database.createUrl=jdbc:mysql://localhost/mysql

# The JDBC URL that will be used to create tables in your database.
torque.database.buildUrl=jdbc:mysql://localhost/BddPortalCCG

# The JDBC URL that will be used to access your database.
torque.database.url=jdbc:mysql://localhost/BddPortalCCG

# The JDBC database driver to use when connecting to your database.
torque.database.driver=org.gjt.mm.mysql.Driver

# The administrative username that has sufficient privileges to create # and 
drop databases and tables that Torque executes at generation time.
torque.database.user=

# The administrative password for the supplied username.
torque.database.password=

# The hostname or IP address of your database server.
torque.database.host=localhost

# The location of the your *-schema.xml files (see below).
torque.schema.dir=./schema


- schema.xml   http://db.apache.org/torque/dtd/database_3_1.dtd";>



  



  


Thanks for your help,

Pierre-Alain Branger
Program of Computational Genomics
Campus Morelos
Tel. +52 777 13 100 24
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: There was no DataSourceFactory configured for the connection DATABASE

2006-11-23 Thread Robert Kromkamp
Do you mean the maxIdle property in:

http://jakarta.apache.org/commons/dbcp/configuration.html 

Robert

-Original Message-
From: Thomas Vandahl [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 23, 2006 8:39 PM
To: Apache Torque Users List
Subject: Re: There was no DataSourceFactory configured for the
connection DATABASE

Robert Kromkamp wrote:
> "There was no DataSourceFactory configured for the connection
DATABASE".
> When I restart the webserver/applicationserver everything works fine 
> again. Do you have any ideas what will be the best why to handle this?
> Is there a way to check if the current datasource connections are 
> still valid?
This is a feature of the dbcp-configuration. See the part on
initialization and configuration of the runtime in the Torque
documentation, section SharedPoolDataSource.

Bye, Thomas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



There was no DataSourceFactory configured for the connection DATABASE

2006-11-23 Thread Robert Kromkamp
Hi All,

I've a question about the DataSourceFactory. The database connection are
set up correctly and executing queries works fine. But when I restart
the database server, Torque remembers the "old" database connections and
doesn't recognize a new database connection needs to be set up. The
Error which will occur:

"There was no DataSourceFactory configured for the connection DATABASE".
When I restart the webserver/applicationserver everything works fine
again. Do you have any ideas what will be the best why to handle this?
Is there a way to check if the current datasource connections are still
valid?

Thanks!

Robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Columns are converted to uppercase

2006-07-25 Thread Robert Kromkamp
Hi All again,

The solution below works, but when I execute the following query on postgreSQL:
 
SELECT * FROM myTable
 
I get the response: ERROR:  relation "myTable" does not exist.
Instead I have to execute the following query to get my results:
 
SELECT * FROM "myTable"
 
At the moment while creating java files based on a Torque schema, it's
impossible to use a postgreSQL database in combination with capitals in my 
tables or fields
( e.g: theFieldName) without using quotes. Is there a solution for my problem? 
So the quotes are not generated for the tables and columns.

Robert


-Original Message-
From: Thoralf Rickert [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 19, 2006 9:58 AM
To: Apache Torque Users List
Subject: AW: Columns are converted to uppercase

Hi,

there is currently a discussion about that problem on this list and a bug 
report ( http://issues.apache.org/jira/browse/TORQUE-44). If you need it now, 
you have to change the Torque templates that generates the column names in the 
Torque classes (Peer.vm and MapBuilder.vm). There is no switch or property for 
this problem.

bye
Thoralf

> -Ursprüngliche Nachricht-
> Von: Robert Kromkamp [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 19. Juli 2006 09:33
> An: Apache Torque Users List
> Betreff: Columns are converted to uppercase
> 
> 
> Hi All,
> 
> By default, PostgreSQL folds names to lower case. So to "select * from 
> Y" there has to be a table named with a lowercase 'y'. If the table 
> name is really a capital 'Y' you
> need: select * from "Y"
> 
> At the moment while creating java files based on a Torque schema, al 
> columns are converted to uppercase. Is there an option to converted 
> the columns exactly as they are described in the schema.xml (I've a 
> mix of upper and lowercase like a column PersonFirstname)? At the 
> moment I am using Torque-3.1.1.
> 
> Cheers,
> Robert
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Columns are converted to uppercase

2006-07-19 Thread Robert Kromkamp
Hi All,

By default, PostgreSQL folds names to lower case. So to "select * from
Y" there has to be a table named with a lowercase 'y'. If the table name
is really a capital 'Y' you need: select * from "Y"

At the moment while creating java files based on a Torque schema, al
columns are converted to uppercase. Is there an option to converted the
columns exactly as they are described in the schema.xml (I've a mix of
upper and lowercase like a column PersonFirstname)? At the moment I am
using Torque-3.1.1.

Cheers,
Robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



id broker occurs duplicate key

2006-01-31 Thread Robert Kromkamp
Hi All,

I get the error below. I'm using torque 3.1.1 and postgres 8.0 . I wonder why 
the quantity of the specific record in id-table is increased and one second 
later it will fail during an insert. This table is only accessed by using the 
idbroker method of Torque. It worked for 2 months perfectly except for now. 
Does anyone has an idea?

2006/01/31 11:05:59 | - Forced id retrieval - no available list
2006/01/31 11:05:59 | - updateQuantity: UPDATE ID_TABLE SET QUANTITY = 3 WHERE 
TABLE_NAME = 'LOCKING'
2006/01/31 11:05:59 | - updateNextId: UPDATE ID_TABLE SET NEXT_ID = 1373 WHERE 
TABLE_NAME = 'LOCKING'
2006/01/31 11:06:00 | - Exception
2006/01/31 11:06:00 | org.apache.torque.TorqueException: java.sql.SQLException: 
ERROR: duplicate key violates unique constraint "locking_pkey"
2006/01/31 11:06:00 |   at 
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:200)
2006/01/31 11:06:00 |   at 
org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:867)

Cheers,
Robert


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: performance

2005-11-04 Thread Robert Kromkamp
Or do mean using the SharedPoolDataSourceFactory instead of other ones?

-Original Message-
From: Robert Kromkamp [mailto:[EMAIL PROTECTED]
Sent: vrijdag 4 november 2005 9:29
To: 'Apache Torque Users List'
Subject: RE: performance


Hi Greg,

Thanks for your answer. I prefer to do something with db connection pooling.
As a understood correctly, you are using another application to deal with
the connection db pooling for torque? Or is it a configuration within
Torque? If you are using another application, can you tell me whcih one you
are using?

Kind regards,

Robert Kromkamp

-Original Message-
From: Greg Monroe [mailto:[EMAIL PROTECTED]
Sent: donderdag 3 november 2005 16:03
To: Apache Torque Users List
Subject: RE: performance


> From: Robert Kromkamp  
> I've got the feeling Torque is al little bit slower than 
> straightforward queries on the database. Are there some way's 
> the improve the performance of torque? By example, use caching?
 
In general, there is no denying that an abstract layer will always 
be slower than a native layer.  Code written in Assembler language 
will always be faster than Java. But why do you use Java instead
of Assembler? The same reasons that people give for developing in 
Java apply to using Torque over native JDBC. You can develop, 
debug, modify, maintain it faster, better, and cheaper.  Remember,
the cost of developer time can quickly outweigh the cost of more 
hardware in today's economics.

That said, there are some internals that make Torque perform better.
IMHO, number one is using pooled connections. One of the most time
consuming JDBC operation is opening a connection to the SQL server.
Pooling eliminates this by caching open connections and letting code 
share them.  I've seen actual major performance gain by converting 
a native JDBC app that did individual connections to Torque.

There are also internal tweaks that may or may not help such as 
the torque.objectIsCaching property that controls whether data 
objects cache foreign keys or not.  I think there are a couple more
but am not sure.

IMHO, it's REALLY hard to cache at the DB interface level because 
you don't have any application context.  Its really easy to have 
a caching scheme that speeds up one type of application but slows 
down another.  Personally, I favor caching the information at the 
object level in the application.  For example, cache fairly 
static, commonly used web application information in the session.  
Or something that is used repeatedly in processing requests, in 
the request object.  Because this is application context specific, 
it tends to be more efficient.

Well, enough soap-boxing.. hopefully this helps or at least 
raises more specific questions we can deal with.

Greg


Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are
confidential communication or may otherwise be privileged or confidential
and are intended solely for the individual or entity to whom they are
addressed.  If you are not the intended recipient you may not rely on the
contents of this email or any attachments, and we ask that you  please not
read, copy or retransmit this communication, but reply to the sender and
destroy the email, its contents, and all copies thereof immediately.  Any
unauthorized dissemination, distribution or copying of this communication is
strictly prohibited.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: performance

2005-11-04 Thread Robert Kromkamp
Hi Greg,

Thanks for your answer. I prefer to do something with db connection pooling.
As a understood correctly, you are using another application to deal with
the connection db pooling for torque? Or is it a configuration within
Torque? If you are using another application, can you tell me whcih one you
are using?

Kind regards,

Robert Kromkamp

-Original Message-
From: Greg Monroe [mailto:[EMAIL PROTECTED]
Sent: donderdag 3 november 2005 16:03
To: Apache Torque Users List
Subject: RE: performance


> From: Robert Kromkamp  
> I've got the feeling Torque is al little bit slower than 
> straightforward queries on the database. Are there some way's 
> the improve the performance of torque? By example, use caching?
 
In general, there is no denying that an abstract layer will always 
be slower than a native layer.  Code written in Assembler language 
will always be faster than Java. But why do you use Java instead
of Assembler? The same reasons that people give for developing in 
Java apply to using Torque over native JDBC. You can develop, 
debug, modify, maintain it faster, better, and cheaper.  Remember,
the cost of developer time can quickly outweigh the cost of more 
hardware in today's economics.

That said, there are some internals that make Torque perform better.
IMHO, number one is using pooled connections. One of the most time
consuming JDBC operation is opening a connection to the SQL server.
Pooling eliminates this by caching open connections and letting code 
share them.  I've seen actual major performance gain by converting 
a native JDBC app that did individual connections to Torque.

There are also internal tweaks that may or may not help such as 
the torque.objectIsCaching property that controls whether data 
objects cache foreign keys or not.  I think there are a couple more
but am not sure.

IMHO, it's REALLY hard to cache at the DB interface level because 
you don't have any application context.  Its really easy to have 
a caching scheme that speeds up one type of application but slows 
down another.  Personally, I favor caching the information at the 
object level in the application.  For example, cache fairly 
static, commonly used web application information in the session.  
Or something that is used repeatedly in processing requests, in 
the request object.  Because this is application context specific, 
it tends to be more efficient.

Well, enough soap-boxing.. hopefully this helps or at least 
raises more specific questions we can deal with.

Greg


Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are
confidential communication or may otherwise be privileged or confidential
and are intended solely for the individual or entity to whom they are
addressed.  If you are not the intended recipient you may not rely on the
contents of this email or any attachments, and we ask that you  please not
read, copy or retransmit this communication, but reply to the sender and
destroy the email, its contents, and all copies thereof immediately.  Any
unauthorized dissemination, distribution or copying of this communication is
strictly prohibited.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



performance

2005-11-02 Thread Robert Kromkamp
Hi All,

I've got the feeling Torque is al little bit slower than straightforward
queries on the database. Are there some way's the improve the performance of
torque? By example, use caching?

Thanks!
Robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (frustrated torque first timer) Please update the Tutorial

2005-08-26 Thread Robert Kromkamp
And that's just the one i needed ...


-Original Message-
From: Aaron Loucks [mailto:[EMAIL PROTECTED]
Sent: donderdag 25 augustus 2005 14:12
To: Apache Torque Users List; [EMAIL PROTECTED]
Subject: RE: (frustrated torque first timer) Please update the Tutorial



FYI..

The link to the runtime properties works now, but the generator page is
missing.

http://db.apache.org/torque/runtime/generator/


Not Found
The requested URL /torque/runtime/generator was not found on this
server.

Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.7a DAV/2 SVN/1.2.0-dev
Server at db.apache.org Port 80


-Original Message-
From: Henning P. Schmiedehausen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 24, 2005 12:22 PM
To: torque-user@db.apache.org
Subject: Re: (frustrated torque first timer) Please update the Tutorial

"Matthias Klein" <[EMAIL PROTECTED]> writes:

>I gave it another try and have a few minor comments.
>Unfortunately, as of today (august 24) I can't find the "new" tutorial
or
>the associated wiki pages on the torque homepage.
>Are they temporarily offline?
>Matt

Should be at http://db.apache.org/torque/runtime/tutorial/index.html

There were some glitches in connection with the SVN reorganisation and
the rebuilding of the site. They should be gone now.

Regards
Henning


-- 

Dipl.-Inf. (Univ.) Henning P. Schmiedehausen  INTERMETA GmbH
[EMAIL PROTECTED]+49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for
hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

  4 - 8 - 15 - 16 - 23 - 42

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: foreign-key

2005-06-09 Thread Robert Kromkamp
Hi Cedric,

You have to specify the javaType in your schema, like:



The javaType wil be a java.lang.Integer instead of a int (which can'n be
null)

Robert


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: donderdag 9 juni 2005 10:04
To: Apache Torque Users List
Subject: foreign-key



foreign-key wich can be null ?!?

My shema :


   
   
   ...
 
  
 


I have tried :
 oUtilisateur.setNumeroservice(0);
  and
 oUtilisateur.setService(null);

But Torque want a reference in Service...
A solution is to remove the RelationUtilisateur2

Have you an other ?

Thanks Cedric



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: nullpointer BasePeer

2005-06-03 Thread Robert Kromkamp
Hi Thomas,

I think I found the problem. I'm using RMI. The problem is I've got 2 Torque
instances, one at the webserver and one at the rmi. Cause RMI is
(de)serializing the criteria, Torque at the rmi-side isn't initialized
correctly with deserializing.

I'm now working on a workaround.

Robert

-Original Message-
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
Sent: vrijdag 3 juni 2005 11:24
To: Apache Torque Users List
Subject: RE: nullpointer BasePeer







Hi Robert,

the query looks ok to me. This is not the problem.

Hopefully you can debug your code. If yes, try to locate the static
initializer in your AdresPeer class. It is quite at the beginning and it
looks like the following
(with changed variable names,).

...
  /** the column name for the NAME field */
public static final String NAME;
  /** the column name for the VORNAME field */
public static final String VORNAME;

static
{
   NAME = "benutzer.NAME";
  VORNAME = "benutzer.VORNAME";
  if (Torque.isInit())
...

Try to put a breakpoint into the first line into the "static { " block,
i.e. in my case the line  "NAME = "benutzer.NAME";".
Do the same for one other class with which you have no problem (just to see
that the breakpoints work at tthat place)

Then put also a breakpoint at your doSelect statement.
Start your application and see whether the static initializer gets called
before the select.
If yes, debug into the following lines of the static initializer. There,
the Adres Map builder should be put into the dbMap.

Please mail back to the list with your findings.

 Thomas

Robert Kromkamp <[EMAIL PROTECTED]> schrieb am 03.06.2005 10:48:58:

> Hi Thomas,
>
> Thanks for your reaction and time! I've tried really a lot, also changed
the
> orderning of calling methods, but nothing solved the error. I still get
the
> NullPointer, cause the Adres table is not in the dbMap, while I try to
sort
> on it.
>
> String package = 'nl.pagelink.torque.opm';
> String table = 'OBJECTEN';
> String column = 'NAAM_OBJECT';
> String class = 'Objecten';
> String value = "%drie%";
>
> Criteria critiera = new Criteria();
> Criterion criterion = criteria.getNewCriterion (table+"."+column, value,
> criteriaObject.ILIKE);
> criteria.add(criterion);
> criteria.addJoin(ObjectenPeer.OBJECT_ID, ObjectAdresPeer.OBJECT_ID);
> criteria.addJoin(ObjectAdresPeer.ADRES_ID, AdresPeer.ADRES_ID);
> criteria.addAscendingOrderByColumn("ADRES.POSTCODE");
>
> List objecten = ObjectenPeer.doSelect(criteria);
>
> It result in the following query:
>
> SELECT OBJECTEN.OBJECT_ID, OBJECTEN.NAAM_OBJECT,
> OBJECTEN.X_COORDINAAT_ADRES, OBJECTEN.Y_COORDINAAT_ADRES,
> OBJECTEN.Z_COORDINAAT_ADRES, UPPER(ADRES.ADRES_ID) FROM OBJECTEN,
> OBJECT_ADRES, ADRES WHERE OBJECTEN.NAAM_OBJECT ILIKE '%drie%' AND
> OBJECTEN.OBJECT_ID=OBJECT_ADRES.OBJECT_ID AND
> OBJECT_ADRES.ADRES_ID=ADRES.ADRES_ID ORDER BY UPPER(ADRES.ADRES_ID) ASC
>
> There are no columns of the joined tables in the query, is this correct?
>
> Hopefully I forgot something ... perhaps do you have some new ideas?
>
> Robert
>
> -Original Message-
> From: Thomas Fischer [mailto:[EMAIL PROTECTED]
> Sent: donderdag 2 juni 2005 17:07
> To: Apache Torque Users List
> Subject: RE: nullpointer BasePeer
>
>
>
>
>
>
> Hi,
>
> your problem is that you do not use the constants in the peer class to
> create the link, but use String constants instead. For example, you use
>
> criteria.addJoin("OBJECTEN.OBJECT_ID", "OBJECT_ADRES.OBJECT_ID");
>
> instead of (hopefully I got the name of the constants right)
>
> criteria.addJoin(ObjektenPeer.OBJECT_ID, ObjectAdresPeer.OBJECT_ID);
>
> If you do not access a Peer class before executing a query which uses
> information from this Peer, the problem occurs.
>
> If you are interested in the background, see
> http://issues.apache.org/scarab/issues/id/TRQS228
>
>Thomas
>
>
>
> Robert Kromkamp <[EMAIL PROTECTED]> schrieb am 01.06.2005 16:05:17:
>
> > Hi Thomas,
> >
> > Thanks for your reaction! I'm using Torque 3.1.1. I really don't know
> what
> > is going wrong.
> >
> > I'm sure I added the adres into the schema.xml. When I change the order
> by
> > to the top table (on which the doSelect is executed), everything works
> fine
> > and I also get addresses in my result.
> >
> > I've 3 tables which are involved in my example, namely
> >
> > OBJECTEN (top)
> > OBJECT_ADRES (Mapping table which has a foreign key to Objecten and a
>

RE: nullpointer BasePeer

2005-06-03 Thread Robert Kromkamp
Hi Thomas,

Thanks for your reaction and time! I've tried really a lot, also changed the
orderning of calling methods, but nothing solved the error. I still get the
NullPointer, cause the Adres table is not in the dbMap, while I try to sort
on it.

String package = 'nl.pagelink.torque.opm';
String table = 'OBJECTEN';
String column = 'NAAM_OBJECT';
String class = 'Objecten';
String value = "%drie%";

Criteria critiera = new Criteria();
Criterion criterion = criteria.getNewCriterion (table+"."+column, value,
criteriaObject.ILIKE);
criteria.add(criterion);
criteria.addJoin(ObjectenPeer.OBJECT_ID, ObjectAdresPeer.OBJECT_ID);
criteria.addJoin(ObjectAdresPeer.ADRES_ID, AdresPeer.ADRES_ID);
criteria.addAscendingOrderByColumn("ADRES.POSTCODE");

List objecten = ObjectenPeer.doSelect(criteria);

It result in the following query:

SELECT OBJECTEN.OBJECT_ID, OBJECTEN.NAAM_OBJECT,
OBJECTEN.X_COORDINAAT_ADRES, OBJECTEN.Y_COORDINAAT_ADRES,
OBJECTEN.Z_COORDINAAT_ADRES, UPPER(ADRES.ADRES_ID) FROM OBJECTEN,
OBJECT_ADRES, ADRES WHERE OBJECTEN.NAAM_OBJECT ILIKE '%drie%' AND
OBJECTEN.OBJECT_ID=OBJECT_ADRES.OBJECT_ID AND
OBJECT_ADRES.ADRES_ID=ADRES.ADRES_ID ORDER BY UPPER(ADRES.ADRES_ID) ASC

There are no columns of the joined tables in the query, is this correct?

Hopefully I forgot something ... perhaps do you have some new ideas?

Robert

-Original Message-
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
Sent: donderdag 2 juni 2005 17:07
To: Apache Torque Users List
Subject: RE: nullpointer BasePeer






Hi,

your problem is that you do not use the constants in the peer class to
create the link, but use String constants instead. For example, you use

criteria.addJoin("OBJECTEN.OBJECT_ID", "OBJECT_ADRES.OBJECT_ID");

instead of (hopefully I got the name of the constants right)

criteria.addJoin(ObjektenPeer.OBJECT_ID, ObjectAdresPeer.OBJECT_ID);

If you do not access a Peer class before executing a query which uses
information from this Peer, the problem occurs.

If you are interested in the background, see
http://issues.apache.org/scarab/issues/id/TRQS228

   Thomas



Robert Kromkamp <[EMAIL PROTECTED]> schrieb am 01.06.2005 16:05:17:

> Hi Thomas,
>
> Thanks for your reaction! I'm using Torque 3.1.1. I really don't know
what
> is going wrong.
>
> I'm sure I added the adres into the schema.xml. When I change the order
by
> to the top table (on which the doSelect is executed), everything works
fine
> and I also get addresses in my result.
>
> I've 3 tables which are involved in my example, namely
>
> OBJECTEN (top)
> OBJECT_ADRES (Mapping table which has a foreign key to Objecten and a
> Foreign Key to Adres )
> ADRES (Contains the order by)
>
> String package = 'nl.pagelink.torque.opm';
> String table = 'OBJECTEN';
> String column = 'NAAM_OBJECT';
> String class = 'Objecten';
> String value = "%drie%";
> String comparator = 'ILIKE';
>
> Criteria critiera = new Criteria();
> Criterion criterion = criteria.getNewCriterion (table+"."+column, value,
> criteriaObject.ILIKE);
> criteria.add(criterion);
> criteria.addJoin("OBJECTEN.OBJECT_ID", "OBJECT_ADRES.OBJECT_ID");
> criteria.addJoin("OBJECT_ADRES.ADRES_ID", "ADRES.ADRES_ID");
> criteria.addAscendingOrderByColumn("ADRES.POSTCODE");
>
> List objecten = ObjectenPeer.doSelect(criteria);
>
>
> This occurs the following exception:
>
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> nl.pagelink.engine.common.CommonEngine.getObjectsByCriteria(Unknown S
> ource)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
> at sun.rmi.transport.Transport$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Unknown Source)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown
Source)
> at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
> Sour
> ce)
> at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.torque.T

RE: nullpointer BasePeer

2005-06-02 Thread Robert Kromkamp
Hi,

Below I added the relative tables from the schema.xml 



http://db.apache.org/torque/dtd/database_3_1.dtd";>



















































Regards,
Robert
-Original Message-
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: nullpointer BasePeer

2005-06-01 Thread Robert Kromkamp
Hi Thomas,

Thanks for your reaction! I'm using Torque 3.1.1. I really don't know what
is going wrong.

I'm sure I added the adres into the schema.xml. When I change the order by
to the top table (on which the doSelect is executed), everything works fine
and I also get addresses in my result.

I've 3 tables which are involved in my example, namely

OBJECTEN (top)
OBJECT_ADRES (Mapping table which has a foreign key to Objecten and a
Foreign Key to Adres )
ADRES (Contains the order by)

String package = 'nl.pagelink.torque.opm';
String table = 'OBJECTEN';
String column = 'NAAM_OBJECT';
String class = 'Objecten';
String value = "%drie%";
String comparator = 'ILIKE';

Criteria critiera = new Criteria();
Criterion criterion = criteria.getNewCriterion (table+"."+column, value,
criteriaObject.ILIKE);
criteria.add(criterion);
criteria.addJoin("OBJECTEN.OBJECT_ID", "OBJECT_ADRES.OBJECT_ID");
criteria.addJoin("OBJECT_ADRES.ADRES_ID", "ADRES.ADRES_ID");
criteria.addAscendingOrderByColumn("ADRES.POSTCODE");

List objecten = ObjectenPeer.doSelect(criteria);


This occurs the following exception:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
nl.pagelink.engine.common.CommonEngine.getObjectsByCriteria(Unknown S
ource)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Sour
ce)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.torque.TorqueException: java.lang.NullPointerException
at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:20
0)
at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1204)
at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(BaseOb
jectenPeer.java:402)
at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(BaseOb
jectenPeer.java:374)
at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelect(BaseObjectenPeer.jav
a:343)
... 16 more
Caused by: java.lang.NullPointerException
at org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1148)
at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1221)
at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1198)
... 19 more


When I a print the dbMap before the error occurs, I see only the tables
ID_TABLE and OBJECTEN are stored in dbMap. 
Because of the order by it needs to know the type of the column, but the
Adres table is not part of the dbMap.
Result -> NullPointer. Does anyone know why Adres is not in the dbMap? Is
something missing in the criteria?


Met vriendelijke groet,
Robert Kromkamp



Pagelink | improves business

Bornsestraat 1d
7556 BA  Hengelo

Postbus 76
7550 AB  Hengelo

tel 074 750 12 50
fax 074 750 12 51

mailto:[EMAIL PROTECTED]
http://www.pagelink.nl
http://www.perrit.nl
http://www.armeo.nl


-Original Message-
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
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 <[EMAIL PROTECTED]> 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 Perso

nullpointer BasePeer

2005-05-30 Thread Robert Kromkamp
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Réf. : date fields / oracle

2005-05-09 Thread Robert Kromkamp
Does it really go wrong with inserting the record into the database?

What's the result when you just print the date/timestamp before saving it.
Perhaps you do something wrong with assigning a value.

-Original Message-
From: Roel van Dijk [mailto:[EMAIL PROTECTED]
Sent: maandag 9 mei 2005 16:44
To: Apache Torque Users List
Subject: Re: Réf. : date fields / oracle


On 5/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> You can use TIMESTAMP instead of DATE
> 

This still gives me me a time of 00:00:00 in the database..

-- 
Roel -- [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Bad Zip in download area

2005-04-21 Thread Robert Kromkamp
Does anyone know how to use Maven within Eclipse?

-Original Message-
From: Brent Atkins [mailto:[EMAIL PROTECTED]
Sent: woensdag 20 april 2005 21:48
To: Apache Torque Users List
Subject: Re: Bad Zip in download area


Then can I recommend taking  look at Maventide Netbeans over at CodeHaus

http://mevenide.codehaus.org/mevenide-netbeans-project/index.html

Pietro Federico wrote:

> Thomas Fischer wrote:
>
>> Well, if somebody absolutely wants to use ant instead of maven, the ant
>> scripts contained  in Torque 3.1 still run with 3.1.. However, I'd
>> recommend to use maven.
>>
>>  
>>
>>> Hi,
>>>
>>> It's correct. Ant is replaced by maven in torque-3.1.1 you can read   
>>
> One reason why using ant could be that I'm tring to use it with 
> Netbeans4 ant only projects.
>
>
> Thanks
> Pietro.-
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Bad Zip in download area

2005-04-20 Thread Robert Kromkamp
Hi,

It's correct. Ant is replaced by maven in torque-3.1.1 you can read it in:

http://db.apache.org/torque/maven-howto.html

Cheers,
Robert

-Original Message-
From: Pietro Federico [mailto:[EMAIL PROTECTED]
Sent: woensdag 20 april 2005 16:09
To: torque-user@db.apache.org
Subject: Bad Zip in download area


hi All,
I have noticed that in the download area the zip for torque-gen-3.1.1 
doesn't contain all the files, expecially for the build.xml ant script.
Is that correct?

Pietro.-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help - Tutorial

2005-04-05 Thread Robert Kromkamp
Hi,

It doesn't really matter which projectname you use, i just leave it
"bookstore". I guess it isn't used anymore.
The most important thing is to put $PROJECT_NAME$-schema.xml into the schema
directory. 
>From every file with the extension "-schema.xml" torque classes will be
generated.

Did you downloaded the torque-gen-3.1.1 distribution?

Robert

-Original Message-
From: Anil More [mailto:[EMAIL PROTECTED]
Sent: dinsdag 5 april 2005 11:36
To: torque-user@db.apache.org
Subject: Help - Tutorial


Hi,

 

An extract from the Tutorial - Step 2:  

 

{1. You configure the generator by setting properties in the
project.properties file in root directory of your project - this is the file
that we will edit first.}

 

If torque.project = bookstore, then is the "root directory" of the project
"bookstore"?

 

Thank you.

 

- Anil


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Torque Runtime configuration in torque-3.1.1.tar.gz

2005-04-05 Thread Robert Kromkamp
Hi,

Torque-3.1.1. uses Maven instead of Ant, you can read it in:

http://db.apache.org/torque/maven-howto.html

If you don't want to use maven you can try to copy the build.xml from the
3.1 release.

Robert

-Original Message-
From: Anil More [mailto:[EMAIL PROTECTED]
Sent: dinsdag 5 april 2005 11:40
To: torque-user@db.apache.org
Subject: Torque Runtime configuration in torque-3.1.1.tar.gz


Hi,

The Tutorial says:

" The runtime distribution archive includes an Ant build file that can
be used to generate your Torque runtime configuration. When you unpack
the archive you will see the following: "

However, I don't see a build.xml file in the runtime bundle I
downloaded - torque-3.1.1.tar.gz.

Thank you.

- Anil

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem with Criteria After Deserializing

2005-03-29 Thread Robert Kromkamp
Hi,

Normally it's handled by JDK, I think by the Object class. I'm using RMI ...
so i'm also using serialisation. Comparing the toString() before and after
serialisation gave some differences. There where some problems with
serializing Hashtables and Uniquelists. Those where not handled by JDK.
That's why I wrote those extra methods.

Robert


-Original Message-
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
Sent: dinsdag 29 maart 2005 9:44
To: Apache Torque Users List
Subject: RE: Problem with Criteria After Deserializing






Hi,

I do not have any experience with serialisation and deserialisation. I did
not find any custom serialize() and deserialize() methods in criteria, but
I thought the JDK handles this automatically. Ist that not true ?

By the way, I do not see the Criteria object as a long-lived object. They
tend to get modified in Queries, so I usually just throw them away after
they are used.

 Thomas

Robert Kromkamp <[EMAIL PROTECTED]> schrieb am 29.03.2005 09:20:56:

> I had the same problem. To solve it I've written my own serialize and
> deserialize functions for Criteria.java for torque 3.1.1:
>
> /** Serialize this Object in a manner which is binary-compatible with the
> JDK */
> private void writeObject(ObjectOutputStream s) throws IOException {
>  ObjectOutputStream.PutField oFields;
>  Iterator it = entrySet().iterator();
>  Map.Entry oEntry;
>  oFields = s.putFields();
>
>  oFields.put("offset", this.offset);
>  oFields.put("limit", this.limit);
>  oFields.put("ignoreCase", ignoreCase);
>  oFields.put("singleRecord", isSingleRecord());
>  oFields.put("cascade", isCascade());
>  oFields.put("dbName", getDbName());
>
>  oFields.put("selectModifiers",
> getSelectModifiers());
>  oFields.put("selectColumns", getSelectColumns());
>  oFields.put("orderByColumns", getOrderByColumns());
>
>  oFields.put("groupByColumns", getGroupByColumns());
>  oFields.put("having", getHaving());
>  oFields.put("asColumns", getAsColumns());
>  oFields.put("joinL", getJoinL());
>  oFields.put("joinR", getJoinR());
>  oFields.put("aliases", this.aliases);
>
>  oFields.put("useTransaction", this.useTransaction);
>  oFields.put("originalDbName", this.originalDbName);
>
>  s.writeFields();
>
>  //s.writeInt(capacity);
>  s.writeInt(super.size());
>  while (it.hasNext())
>  {
> oEntry = (Map.Entry) it.next();
> String key = (String)oEntry.getKey();
> s.writeObject(key);
> s.writeObject(oEntry.getValue());
>
>  if (this.containsKey(key)){
>  Criterion aCriterion =
> this.getCriterion(key);
>  s.writeObject(aCriterion);
>  } else {
>  s.writeObject(new Boolean(false));
>  }
>  }
> }
>
>
>
> /** Deserialize this Object in a manner which is binary-compatible
with
> the JDK */
>
> private void readObject(ObjectInputStream s) throws IOException,
> ClassNotFoundException
> {
>   int i;
>   int iLen;
>   Object oKey, oValue, oCriterion;
>   ObjectInputStream.GetField oFields;
>   oFields = s.readFields();
>
>  this.offset = oFields.get("offset", 0);
>  this.limit = oFields.get("limit", -1);
>  ignoreCase = oFields.get("ignoreCase", false);
>  singleRecord = oFields.get("singleRecord", false);
>  cascade = oFields.get("cascade", false);
>  dbName = (String) oFields.get("dbName", "");
>  selectModifiers = (UniqueList)
> oFields.get("selectModifiers", new UniqueList());
>  selectColumns = (UniqueList)
> oFields.get("selectColumns", new UniqueList());
>  orderByColumns = (UniqueList)
> oFields.get("orderByColumns", new UniqueList());
>
>  groupByColumns =
> (UniqueList)oFields.get("groupByColumns", new UniqueList());
>
>  having = (Criteria.Criterion)oFields.get("having",
> null);
>  asColumns = (Hashtable)oFields.get("asColumns",
> null);
>  joinL = (ArrayList)oFields.get("joinL", null);
>  joinR = (ArrayList)oFields.get("joinR", nul

RE: oracle 9i and torque

2005-03-28 Thread Robert Kromkamp
Is it possible to get a connection from a standalone (test) java application
while using the same properties?
-Original Message-
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
Sent: dinsdag 29 maart 2005 9:22
To: Apache Torque Users List
Subject: RE: oracle 9i and torque






Hi,

seems that your database connection does not work.
Are you sure you have the right SID, username and password ? Also, a
firewall might be problematic...

 Thomas

"Dressler, Erik(externe MA)" <[EMAIL PROTECTED]> schrieb am
18.03.2005 15:15:30:

>
> hello, everybody!
>
> i have a big problem! i wasted days of my life trying to get turbine,
torque
> and oracle started! i'm a little bit confused now. so i need your help!!!
>
> i'm using:
> turbine 2.3.1
> torque 3.1.1
> oracle 9i
> java 1.4
> tomcat 5.0.28
> maven 1.0.2
>
> my build.properties:
>
> #

> # P A R A M E T E R   F O R   B U I L D I N G
> #
> # $Id: build.properties,v 1.3 2004/10/31 16:11:36 henning Exp $
> #
> #

>
> project.home = c:/Diplomarbeit/portal01
>
> #
> # Application Server configuration
> #
> maven.appserver.home =  C:/Programme/Apache/Tomcat5.0/
> maven.appserver.name =  tomcat
>
> #
> # Initial ID values for the ID_TABLE
> #
> initialID = 1100
> initialIDValue = 100
> initialIDStep = 10
>
> torque.database.driver = oracle.jdbc.driver.OracleDriver
> torque.database.user = portal01
> torque.database.password = portal01
> torque.database.buildUrl = jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
> torque.database.createUrl = jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
>
> my torque-relevant entries in TurbineResources.properties:
>
> # Torque
>
> torque.database.default.driver = oracle.jdbc.driver.OracleDriver
> torque.database.default.url =
jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
> torque.database.default.username = portal01
> torque.database.default.password = portal01
>
> torque.database.adapter = oracle
> torque.database.adapter.oracle = oracle.jdbc.driver.OracleDriver
>
> my Torque.properties:
>
> #
> # application database
> #
> torque.database.default = portal01
> torque.database.portal01.adapter = oracle
> torque.dsfactory.portal01.factory =
> org.apache.torque.dsfactory.SharedPoolDataSourceFactory
> torque.dsfactory.portal01.connection.driver =
> oracle.jdbc.driver.OracleDriver
> torque.dsfactory.portal01.connection.url =
> jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
> torque.dsfactory.portal01.connection.user =   portal01
> torque.dsfactory.portal01.connection.password =   portal01
>
> torque.dsfactory.portal01.pool.maxActive = 30
> torque.dsfactory.portal01.pool.testOnBorrow = true
> torque.dsfactory.portal01.pool.validationQuery = SELECT 1
>
> my project.properties:
>
> # ---
> #
> # T O R Q U E  C O N F I G U R A T I O N
> #
> # used to generate the initial data for the security tables
> #
> # ---
>
> torque.database = oracle
> torque.project = portal01
> torque.target.package = lu.dresdner_bank.portal01.db
>
> torque.java.dir = target/src
> torque.sql.dir = target/sql
> torque.output.dir =   target/sql
> torque.schema.dir =   target/xml
> torque.contextProperties = build.properties
> torque.basePrefix = Base
> #
> # As the current Torque cannot build a peer class for
> # the ID broker table, it is necessary to exclude all
> # the generated ID tables from OM generation. So you
> # must keep the following property here until Torque
> # no longer has a name clash between the TABLE_NAME
> # column and the internal TABLE_NAME variable.
> #
> torque.schema.om.excludes =   *id-table-schema*.xml
>
> torque.addSaveMethod = true
> torque.runOnlyOnSchemaChange = true
> torque.saveException = Exception
> torque.addIntakeRetrievable = true
> torque.retrievableInterface = org.apache.turbine.om.Retrievable
>
> torque.database.createUrl =
jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
> torque.database.buildUrl = jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
> torque.database.url = jdbc:oracle:thin:@130.3.15.173:1530:EAITEST9
> torque.database.driver = oracle.jdbc.driver.OracleDriver
> torque.database.user = portal01
> torque.database.password = portal01
> torque.database.host = 130.3.15.173
>
> my error-message:
>
> 2005-03-18 15:02:37,346 [http-8080-Processor24] ERROR
> org.apache.turbine.services.velocity.TurbineVelocityService - Class
> lu.dresdner_bank.portal01.tools.ProcessTool.getProcesses threw Exception
> org.apache.torque.TorqueException:
> org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection
> info from pool
>at
> org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:717)
>at org.apache.torque.Torque.getConnection(Torque.java:268)
>at org.apache.torque.util.BasePeer.doPSSelect(BasePeer.java:2082)
>at
>
lu.dresdne

RE: Problem with Criteria After Deserializing

2005-03-28 Thread Robert Kromkamp
I had the same problem. To solve it I've written my own serialize and
deserialize functions for Criteria.java for torque 3.1.1:

/** Serialize this Object in a manner which is binary-compatible with the
JDK */
private void writeObject(ObjectOutputStream s) throws IOException {
ObjectOutputStream.PutField oFields;
Iterator it = entrySet().iterator();
Map.Entry oEntry;
oFields = s.putFields();

oFields.put("offset", this.offset);
oFields.put("limit", this.limit);
oFields.put("ignoreCase", ignoreCase);
oFields.put("singleRecord", isSingleRecord());
oFields.put("cascade", isCascade());
oFields.put("dbName", getDbName());

oFields.put("selectModifiers",
getSelectModifiers());
oFields.put("selectColumns", getSelectColumns());
oFields.put("orderByColumns", getOrderByColumns());

oFields.put("groupByColumns", getGroupByColumns());
oFields.put("having", getHaving());
oFields.put("asColumns", getAsColumns());
oFields.put("joinL", getJoinL());
oFields.put("joinR", getJoinR());
oFields.put("aliases", this.aliases);

oFields.put("useTransaction", this.useTransaction);
oFields.put("originalDbName", this.originalDbName);

s.writeFields();

//s.writeInt(capacity);
s.writeInt(super.size());
while (it.hasNext())
{
oEntry = (Map.Entry) it.next();
String key = (String)oEntry.getKey();
s.writeObject(key);
s.writeObject(oEntry.getValue());

if (this.containsKey(key)){
Criterion aCriterion =
this.getCriterion(key);
s.writeObject(aCriterion);
} else {
s.writeObject(new Boolean(false));
}
}
}



/** Deserialize this Object in a manner which is binary-compatible with
the JDK */

private void readObject(ObjectInputStream s) throws IOException,
ClassNotFoundException
{
  int i;
  int iLen;
  Object oKey, oValue, oCriterion;
  ObjectInputStream.GetField oFields;
  oFields = s.readFields();

this.offset = oFields.get("offset", 0);
this.limit = oFields.get("limit", -1);
ignoreCase = oFields.get("ignoreCase", false);
singleRecord = oFields.get("singleRecord", false);
cascade = oFields.get("cascade", false);
dbName = (String) oFields.get("dbName", "");
selectModifiers = (UniqueList)
oFields.get("selectModifiers", new UniqueList());
selectColumns = (UniqueList)
oFields.get("selectColumns", new UniqueList());
orderByColumns = (UniqueList)
oFields.get("orderByColumns", new UniqueList());

groupByColumns =
(UniqueList)oFields.get("groupByColumns", new UniqueList());

having = (Criteria.Criterion)oFields.get("having",
null);
asColumns = (Hashtable)oFields.get("asColumns",
null);
joinL = (ArrayList)oFields.get("joinL", null);
joinR = (ArrayList)oFields.get("joinR", null);
aliases = (HashMap)oFields.get("aliases", null);

useTransaction = oFields.get("useTransaction",
false);
originalDbName =
(String)oFields.get("originalDbName", "");

iLen = s.readInt();
  
for (i = 0; i < iLen; i++){
  oKey = s.readObject();
  oValue = s.readObject();
  super.put(oKey, oValue);
  
  oCriterion = s.readObject();
  if (oCriterion instanceof
org.apache.torque.util.Criteria.Criterion){
Criterion criterion = (Criterion)
oCriterion;
add(criterion);
  }
}
}


-Original Message-
Fr

RE: build-torque.xml not found in 3.1.1 release

2005-03-22 Thread Robert Kromkamp
You need to compile without ant 

Use "maven torque" on the commandline. There's a maven tutarial op the
torque website.

Another idea is to copy the build file from the 3.1 version.

Cheers,
Robert

-Original Message-
From: Laran Evans [mailto:[EMAIL PROTECTED]
Sent: dinsdag 22 maart 2005 17:31
To: Mailing List -
Subject: build-torque.xml not found in 3.1.1 release



I've downloaded 3.1.1 in jar and zip format from multiple mirrors and I have
not found build-torque.xml in any of them.

Are the docs outdated?

What's the current suggested method for invoking Torque from Ant?

Laran Evans - Cornell University
p: (607) 255-6864 f: (607) 255-0327




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: NullPointerException BasePeer within torque-3.1.1

2005-03-03 Thread Robert Kromkamp
It still doesn't work. Has no one another solution?

-Original Message-
From: Robert Kromkamp [mailto:[EMAIL PROTECTED]
Sent: vrijdag 25 februari 2005 16:46
To: 'Apache Torque Users List'
Subject: RE: NullPointerException BasePeer within torque-3.1.1


Thanks for your reaction ...

I've changed the order (tried many many many ways) but it didn't work.

Perhaps you could send me a piece of your code?

The eaxmple below works fine without adding the criterion. I found out i
needed to reverse the addJoin to:
criteria.addJoin(Object2Peer.OBJECT_2_ID, ObjectsPeer.OBJECT_ID);

When i add the criterion based on a child table (object2) of objects i will
get the NullPointerException.
I only get an error when the criterion Peer (in my case Object2Peer) is
different than the one which executes the doSelect (ObjectsPeer).

I think the tables of the criterion peer should also be placed in the DbMap.


-Original Message-
From: Adam Allgaier [mailto:[EMAIL PROTECTED]
Sent: vrijdag 25 februari 2005 16:15
To: Apache Torque Users List
Subject: Re: NullPointerException BasePeer within torque-3.1.1


I've received a NullPointerException in similar situations, resolved by
changing the order of the criteria.addJoin(...) command and the
criteria.add(..)

(I think putting the addJoin(...) after the add(...)

Adam

> >Robert Kromkamp wrote:
> >
> >  
> >
> >>Hi,
> >>
> >>When I try to add setIngnoreCase(true) within the following statement I
get
> >>a NullPointerException in BasePeer.java.
> >>
> >>Criteria criteria = new Criteria();
> >>criteria.setIngnoreCase(true);
> >>criteria.addJoin(ObjectsPeer.OBJECT_ID, Object2Peer.OBJECT_2_ID);
> >>Criteria.criterion criterion =
> >>criteria.getNewCriterion(Object2Peer.BOUWLAGEN, "%4%", Criteria.LIKE);
> >>criteria.add(criterion);
> >>objects = ObjectsPeer.doSelect(criteria);
> >>
> >>I did take a look in de the BasePeer.java. The NullPointerException is
> >>thrown because the table "OBJECT_2" is not part of the dbMap. 
> >>When I print the contents of this Map I get the following result.
> >>
> >>- ID_TABLE
> >>- OBJECTEN
> >>
> >>OBJECT_2  is not part of it but I use it in my query.
> >>
> >>Because I set the ignore case it will check in the code if the column
type
> >>is equal to String. Because OBJECT_2 is not part of the dbMap it cannot
get
> >>the table description of OBJECT_2 and it it will throw a
> >>NullPointerException. 
> >>
> >>Does anyone know how to solve it?
> >>
> >>Thanks for your time!
> >>
> >>Kind regards,
> >>Robert Kromkamp
> >>
> >>
> >>java.lang.reflect.InvocationTargetException
> >>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >>at java.lang.reflect.Method.invoke(Unknown Source)
> >>at nl.pagelink.engine.common.CommonEngine.getObjectsByCriteria(Unknown
> >>Source)
> >>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >>at java.lang.reflect.Method.invoke(Unknown Source)
> >>at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
> >>at sun.rmi.transport.Transport$1.run(Unknown Source)
> >>at java.security.AccessController.doPrivileged(Native Method)
> >>at sun.rmi.transport.Transport.serviceCall(Unknown Source)
> >>at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
> >>at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
> >>
> >>
> >Source)
> >  
> >
> >>at java.lang.Thread.run(Unknown Source)
> >>Caused by: org.apache.torque.TorqueException:
> >>
> >>
> >java.lang.NullPointerException
> >  
> >
> >>at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:200)
> >>at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1204)
> >>at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
> >>Source)
> >>at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
> >>Source)
> >>at nl.pagelink.torque.opm.BaseObjectenPeer.doSelect(Unknown Source)
> >>... 16 more
> >>Caused by: java.lang.NullPointerException
> >

RE: NullPointerException BasePeer within torque-3.1.1

2005-02-25 Thread Robert Kromkamp
Thanks for your reaction ...

I've changed the order (tried many many many ways) but it didn't work.

Perhaps you could send me a piece of your code?

The eaxmple below works fine without adding the criterion. I found out i
needed to reverse the addJoin to:
criteria.addJoin(Object2Peer.OBJECT_2_ID, ObjectsPeer.OBJECT_ID);

When i add the criterion based on a child table (object2) of objects i will
get the NullPointerException.
I only get an error when the criterion Peer (in my case Object2Peer) is
different than the one which executes the doSelect (ObjectsPeer).

I think the tables of the criterion peer should also be placed in the DbMap.


-Original Message-
From: Adam Allgaier [mailto:[EMAIL PROTECTED]
Sent: vrijdag 25 februari 2005 16:15
To: Apache Torque Users List
Subject: Re: NullPointerException BasePeer within torque-3.1.1


I've received a NullPointerException in similar situations, resolved by
changing the order of the criteria.addJoin(...) command and the
criteria.add(..)

(I think putting the addJoin(...) after the add(...)

Adam

> >Robert Kromkamp wrote:
> >
> >  
> >
> >>Hi,
> >>
> >>When I try to add setIngnoreCase(true) within the following statement I
get
> >>a NullPointerException in BasePeer.java.
> >>
> >>Criteria criteria = new Criteria();
> >>criteria.setIngnoreCase(true);
> >>criteria.addJoin(ObjectsPeer.OBJECT_ID, Object2Peer.OBJECT_2_ID);
> >>Criteria.criterion criterion =
> >>criteria.getNewCriterion(Object2Peer.BOUWLAGEN, "%4%", Criteria.LIKE);
> >>criteria.add(criterion);
> >>objects = ObjectsPeer.doSelect(criteria);
> >>
> >>I did take a look in de the BasePeer.java. The NullPointerException is
> >>thrown because the table "OBJECT_2" is not part of the dbMap. 
> >>When I print the contents of this Map I get the following result.
> >>
> >>- ID_TABLE
> >>- OBJECTEN
> >>
> >>OBJECT_2  is not part of it but I use it in my query.
> >>
> >>Because I set the ignore case it will check in the code if the column
type
> >>is equal to String. Because OBJECT_2 is not part of the dbMap it cannot
get
> >>the table description of OBJECT_2 and it it will throw a
> >>NullPointerException. 
> >>
> >>Does anyone know how to solve it?
> >>
> >>Thanks for your time!
> >>
> >>Kind regards,
> >>Robert Kromkamp
> >>
> >>
> >>java.lang.reflect.InvocationTargetException
> >>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >>at java.lang.reflect.Method.invoke(Unknown Source)
> >>at nl.pagelink.engine.common.CommonEngine.getObjectsByCriteria(Unknown
> >>Source)
> >>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >>at java.lang.reflect.Method.invoke(Unknown Source)
> >>at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
> >>at sun.rmi.transport.Transport$1.run(Unknown Source)
> >>at java.security.AccessController.doPrivileged(Native Method)
> >>at sun.rmi.transport.Transport.serviceCall(Unknown Source)
> >>at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
> >>at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
> >>
> >>
> >Source)
> >  
> >
> >>at java.lang.Thread.run(Unknown Source)
> >>Caused by: org.apache.torque.TorqueException:
> >>
> >>
> >java.lang.NullPointerException
> >  
> >
> >>at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:200)
> >>at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1204)
> >>at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
> >>Source)
> >>at
nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
> >>Source)
> >>at nl.pagelink.torque.opm.BaseObjectenPeer.doSelect(Unknown Source)
> >>... 16 more
> >>Caused by: java.lang.NullPointerException
> >>at org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1015)
> >>at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1221)
> >>at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1198)
> >>... 19 more
> >>
> >>
> >>
> >>
> >>

RE: NullPointerException BasePeer within torque-3.1.1

2005-02-25 Thread Robert Kromkamp
I hope the solution is that easy ... but when i change it to the correct
spelling i get the same result  :-)

-Original Message-
From: Brent Atkins [mailto:[EMAIL PROTECTED]
Sent: vrijdag 25 februari 2005 15:59
To: Apache Torque Users List
Subject: Re: NullPointerException BasePeer within torque-3.1.1


I can tell you that you misspelled setIgnoreCase...

Robert Kromkamp wrote:

>Hi,
> 
>When I try to add setIngnoreCase(true) within the following statement I get
>a NullPointerException in BasePeer.java.
> 
>Criteria criteria = new Criteria();
>criteria.setIngnoreCase(true);
>criteria.addJoin(ObjectsPeer.OBJECT_ID, Object2Peer.OBJECT_2_ID);
>Criteria.criterion criterion =
>criteria.getNewCriterion(Object2Peer.BOUWLAGEN, "%4%", Criteria.LIKE);
>criteria.add(criterion);
>objects = ObjectsPeer.doSelect(criteria);
> 
>I did take a look in de the BasePeer.java. The NullPointerException is
>thrown because the table "OBJECT_2" is not part of the dbMap. 
>When I print the contents of this Map I get the following result.
> 
>- ID_TABLE
>- OBJECTEN
> 
>OBJECT_2  is not part of it but I use it in my query.
> 
>Because I set the ignore case it will check in the code if the column type
>is equal to String. Because OBJECT_2 is not part of the dbMap it cannot get
>the table description of OBJECT_2 and it it will throw a
>NullPointerException. 
> 
>Does anyone know how to solve it?
> 
>Thanks for your time!
> 
>Kind regards,
>Robert Kromkamp
> 
> 
>java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at nl.pagelink.engine.common.CommonEngine.getObjectsByCriteria(Unknown
>Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
> at sun.rmi.transport.Transport$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Unknown Source)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
> at java.lang.Thread.run(Unknown Source)
>Caused by: org.apache.torque.TorqueException:
java.lang.NullPointerException
> at org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:200)
> at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1204)
> at nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
>Source)
> at nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
>Source)
> at nl.pagelink.torque.opm.BaseObjectenPeer.doSelect(Unknown Source)
> ... 16 more
>Caused by: java.lang.NullPointerException
> at org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1015)
> at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1221)
> at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1198)
> ... 19 more
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>  
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



NullPointerException BasePeer within torque-3.1.1

2005-02-25 Thread Robert Kromkamp
Hi,
 
When I try to add setIngnoreCase(true) within the following statement I get
a NullPointerException in BasePeer.java.
 
Criteria criteria = new Criteria();
criteria.setIngnoreCase(true);
criteria.addJoin(ObjectsPeer.OBJECT_ID, Object2Peer.OBJECT_2_ID);
Criteria.criterion criterion =
criteria.getNewCriterion(Object2Peer.BOUWLAGEN, "%4%", Criteria.LIKE);
criteria.add(criterion);
objects = ObjectsPeer.doSelect(criteria);
 
I did take a look in de the BasePeer.java. The NullPointerException is
thrown because the table "OBJECT_2" is not part of the dbMap. 
When I print the contents of this Map I get the following result.
 
- ID_TABLE
- OBJECTEN
 
OBJECT_2  is not part of it but I use it in my query.
 
Because I set the ignore case it will check in the code if the column type
is equal to String. Because OBJECT_2 is not part of the dbMap it cannot get
the table description of OBJECT_2 and it it will throw a
NullPointerException. 
 
Does anyone know how to solve it?
 
Thanks for your time!
 
Kind regards,
Robert Kromkamp
 
 
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at nl.pagelink.engine.common.CommonEngine.getObjectsByCriteria(Unknown
Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
 at sun.rmi.transport.Transport$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.rmi.transport.Transport.serviceCall(Unknown Source)
 at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.torque.TorqueException: java.lang.NullPointerException
 at org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:200)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1204)
 at nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
Source)
 at nl.pagelink.torque.opm.BaseObjectenPeer.doSelectVillageRecords(Unknown
Source)
 at nl.pagelink.torque.opm.BaseObjectenPeer.doSelect(Unknown Source)
 ... 16 more
Caused by: java.lang.NullPointerException
 at org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1015)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1221)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1198)
 ... 19 more