You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Johannes Hamel <j....@gmx.net> on 2002/10/30 14:27:50 UTC
[newbie] criteria questions
Hi,
I am playing around with Turbine and have a few questions:
1) Criteria
>>
Criteria criteria = new Criteria();
criteria.add("Contact."+COLUMN,SEARCHSTRING);
<<
works fine.
>>
Criteria criteria = new Criteria();
criteria.add("contact."+COLUMN,SEARCHSTRING,(Object)Criteria.LIKE);
>>
throws :
>>
Exception: java.sql.SQLException: General error: Access denied for user:
'user01@127.0.0.1' to database 'contact'
Stack Trace follows:
java.sql.SQLException: General error: Access denied for user:
'user01@127.0.0.1' to database 'contact'
...
<<
Why is suddendly my table name inerpreted as my database name?
2) PrimaryKey
After saving an entry with the save()-method I want to get the primarykey,
but getPrimaryKey() returns null.
Anybody can tell me how to acccess the PrimaryKey.
3) addAscendingOrderByColumn()
criteria.addAscendingOrderByColumn("Contact."+COLUMN);
returns null if in my table ist generated with a forgein key in it.
Sorry, for these basic questions...
Johannes
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
AW: [newbie] criteria questions
Posted by Marc Lustig <ma...@marclustig.com>.
> -----Ursprüngliche Nachricht-----
> Von: Johannes Hamel [mailto:j.hamel@gmx.net]
> Gesendet: Mittwoch, 30. Oktober 2002 14:28
> An: turbine-user@jakarta.apache.org
> Betreff: [newbie] criteria questions
>
>
> Hi,
>
> I am playing around with Turbine and have a few questions:
>
> 1) Criteria
>
> >>
>
> Criteria criteria = new Criteria();
> criteria.add("Contact."+COLUMN,SEARCHSTRING);
>
> <<
>
> works fine.
>
> >>
> Criteria criteria = new Criteria();
> criteria.add("contact."+COLUMN,SEARCHSTRING,(Object)Criteria.LIKE);
You add a criteria by using the Peer class, like:
c.add(MyTablePeer.MY_COLUMN, "string");
HTH.
Marc
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>