[JBoss-user] [Persistence CMP/JBoss] - Re: Checking a field against a list of values

2004-05-20 Thread sesques
HI,

JBossQL supports parameters in the IN operator. But is the number of your parameters 
always the same ?

If not, you should use DynamicQL instead.

Pascal


View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3835665#3835665

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3835665


---
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Persistence CMP/JBoss] - Re: Checking a field against a list of values

2004-05-20 Thread Guido Scalise
sesques wrote : HI,
  | 
  | JBossQL supports parameters in the IN operator. But is the number of your 
parameters always the same ?
  | 
  | If not, you should use DynamicQL instead.
  | 
  | Pascal
  | 

Thanks for your prompt reply!
No, the list of parameters varies... :(
I've been searching all the web looking for DynamycQL/JBossQL 
examples/tutorials/documentation, but I haven't found anything... Where can I access 
some (JBoss/Dynamic)QL documentation?

Kind Regards,
Guido Scalise
Buenos Aires - Argentina

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3835666#3835666

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3835666


---
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Persistence CMP/JBoss] - Re: Checking a field against a list of values

2004-05-20 Thread sesques
Hi,

Perhaps a bad news to you. JBossQL and DynamicQL is documented in the JBoss DOCO, and 
you have to buy it.
The DOCO is JBoss AdminDevel Documentation.

Pascal


View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3835667#3835667

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3835667


---
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Persistence CMP/JBoss] - Re: Checking a field against a list of values

2004-05-20 Thread hernant
Que haces Guido,
te paso un ejemplo de un entity bean usando xdoclet:

a nivel de clase (despues de los imports) pone estos tags:

 *  @ejb.select
 *signature=java.util.Collection ejbSelectGeneric( java.lang.String jbossql, 
java.lang.Object[] args )
 *result-type-mapping=Local
 *method-intf=LocalHome
 *query=
 *  @jboss.query
 *signature=java.util.Collection ejbSelectGeneric( java.lang.String jbossql, 
java.lang.Object[] args )
 *dynamic=true
 *  

despues agregs estos metodos al entity mismo:

/**
 * @jboss.dynamic-ql
 */
public abstract java.util.Collection ejbSelectGeneric ( String jbossQl, 
Object[]arguments ) throws FinderException;

/**
 * @ejb.home-method 
 *  tview-type=local 
 */
public java.util.Collection ejbHomeBusquedasGenericas(
String node_name,   String type,String 
alias_name,  String description, String login,   
String passwd,  String transfer_dir,String host_alias, 
 String operational_status,  String ip_address,  String cv_id, 
  String node_type) throws javax.ejb.FinderException{ 

java.util.Collection params = new java.util.ArrayList();
int paramNumber = 1;
boolean yaHayUno = false;

// generate JBossQL query
StringBuffer jbossQl = new StringBuffer();
jbossQl.append(SELECT OBJECT(u) );
jbossQl.append(FROM Dyt_com_nodeSchema AS u );

if (
(node_name!=null  
 !node_name.equalsIgnoreCase(todos)
 !node_name.equalsIgnoreCase()
) 
||  (type!=null  
 !type.equalsIgnoreCase(todos)
 !type.equalsIgnoreCase()
) 
||  (alias_name!=null  
 !alias_name.equalsIgnoreCase(todos)
 !alias_name.equalsIgnoreCase()
) 
||  (description!=null  
 !description.equalsIgnoreCase(todos)
 !description.equalsIgnoreCase()
) 
||  (login!=null  
 !login.equalsIgnoreCase(todos)
 !login.equalsIgnoreCase()
) 
||  (passwd!=null  
 !passwd.equalsIgnoreCase(todos)
 !passwd.equalsIgnoreCase()
) 
||  (transfer_dir!=null  
 !transfer_dir.equalsIgnoreCase(todos)
 !transfer_dir.equalsIgnoreCase()
) 
||  (host_alias!=null  
 !host_alias.equalsIgnoreCase(todos)
 !host_alias.equalsIgnoreCase()
) 
||  (operational_status!=null  
 !operational_status.equalsIgnoreCase(todos)
 !operational_status.equalsIgnoreCase()
) 
||  (ip_address!=null  
 !ip_address.equalsIgnoreCase(todos)
 !ip_address.equalsIgnoreCase()
) 
||  (cv_id!=null  
 !cv_id.equalsIgnoreCase(todos)
 !cv_id.equalsIgnoreCase()
) 
||  (node_type!=null  
 !node_type.equalsIgnoreCase(todos)
 !node_type.equalsIgnoreCase()
) 
)
{
jbossQl.append(WHERE);
}

if (node_name != null 
 !node_name.equalsIgnoreCase(todos)
 !node_name.equalsIgnoreCase()
){
if (yaHayUno) jbossQl.append( AND);
jbossQl.append( u.node_name=? + paramNumber++);
params.add(node_name);
yaHayUno=true;
}
if (type != null 
 !type.equalsIgnoreCase(todos)
 !type.equalsIgnoreCase()
){
if (yaHayUno) jbossQl.append( AND);
jbossQl.append( u.type=? + paramNumber++);
params.add(type);
yaHayUno=true;
}
if (alias_name != null 
 !alias_name.equalsIgnoreCase(todos)
 !alias_name.equalsIgnoreCase()
){
if (yaHayUno) jbossQl.append( AND);
jbossQl.append( u.alias_name=? + paramNumber++);
params.add(alias_name);