hi b�rries,
i can run this sample successfully:
private void queryLike(Implementation odmg) throws Exception
{
OQLQuery query;
Criteria crit;
System.out.println("\nread all persons with name like Br%");
query = odmg.newOQLQuery();
query.create("select allpersons from brj.ojb.Person where name like $1");
query.bind("Br%");
showResult((DList) query.execute());
}
imho you bind a string array not a single string, this could be the problem
hth
jakob
----- Original Message -----
From: "Ludwig, Boerries" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Saturday, August 31, 2002 10:04 AM
Subject: AW: getFksToThisClass
Hi,
thanks, seams to work. I think that I got lost with all these _ - < /> etc.
Unfortunately my queries still not work:
String queryString = null;
Iterator result = null;
PersistenceManager pm = new PersistenceManager();
String attribute = null;
attribute = "url";
if (searchString.trim().equals("")) searchString = "*";
else searchString = "*" + searchString + "*";
// OJB was not able to search with wild cards
// use following method if there is still a problem
// result =
pm.getTemp(Class.forName("com.debis.urlAdmin.dm.Url"),attribute,
searchString);
queryString = "select allurls from com.debis.urlAdmin.dm.Url where
url like $1";
String[] binds = {searchString};
result = pm.get(queryString,binds);
return result;
Is my query with wild-cards wrong ? I tried also with * instead of allurls
but I still not get a result.
Best regards
Boerries
.........................................................................
> -----Urspr�ngliche Nachricht-----
> Von: Jakob Braeuchi [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 26. August 2002 16:12
> An: OJB Users List
> Betreff: Re: getFksToThisClass
>
>
> hi b�rries,
>
> check your collection descriptors:
>
> <collection-descriptor
> name="keywords"
> collection-class="java.util.Vector"
> element-class-ref="com.debis.urlAdmin.dm.Keyword"
> indirection-table="urlkeyword"
> >
> fk-pointing-to-this-class column="url" <<< check syntax
> fk-pointing-to-items-class column="keyword" <<< check syntax
> />
> </collection-descriptor>
>
> hth
> jakob
>
> ----- Original Message -----
> From: "Ludwig, Boerries" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Monday, August 26, 2002 3:02 PM
> Subject: AW: getFksToThisClass
>
>
> Hi Jakob,
>
> I tried ojb 0.9.5 and I got the same problem:
>
> at
> org.apache.ojb.broker.metadata.CollectionDescriptor.getFksToTh
> isClass(Collec
> tionDescriptor.java:92)
> at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.deleteMto
> NImplementor(P
> ersistenceBrokerImpl.java:817)
> at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.storeColl
> ections(Persis
> tenceBrokerImpl.java:689)
> at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Per
> sistenceBroker
> Impl.java:1743)
> at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Per
> sistenceBroker
> Impl.java:1656)
> at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Per
> sistenceBroker
> Impl.java:1645)
> at
> org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.
> java:147)
> at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeT
> able.java:140)
> at
> org.apache.ojb.odmg.TransactionImpl.doCommit(TransactionImpl.java:285)
> at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:469)
> at com.debis.pm.PersistenceManager.save(PersistenceManager.java:198)
> at
> com.debis.htmlGenerator.urlAdministration.UrlAction.saveUrl(Ur
> lAction.java:9
> 3)
>
> During startup I only get two anomalies:
>
> [DEFAULT] INFO: problems with platform
> org.apache.ojb.broker.platforms.PlatformHsqlImpl:
> org.apache.ojb.broker.platforms.PlatformHsqlImpl
>
> [BOOT] INFO: OJB.properties: file:/C:/Programme/eclipse/OJB.properties
> [BOOT] WARN: Value "true" is illegal for key "useAutoCommit"
> (should be an
> integer, using default value 1)
>
> The CollectionDecriptor is not called during initialization
> (only for a
> request with result above).
>
> I included my code in my eMail. It would be nice to have a
> look on it !
>
> Best regards
>
> Boerries
>
> ..............................................................
> ...........
>
>
> > -----Urspr�ngliche Nachricht-----
> > Von: Jakob Braeuchi [mailto:[EMAIL PROTECTED]]
> > Gesendet: Sonntag, 25. August 2002 10:30
> > An: OJB Users List
> > Betreff: Re: getFksToThisClass
> >
> >
> > hi b�rries,
> >
> > please try ojb 0.9.5
> >
> > jakob
> >
> > ----- Original Message -----
> > From: "Ludwig, Boerries" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > Sent: Saturday, August 24, 2002 10:14 PM
> > Subject: getFksToThisClass
> >
> >
> > > Hi,
> > >
> > > I had an old version of OJB and was happy with it. Now I'm
> > unhappy because
> > I
> > > changed to the version jakarta-ojb-0.9.4 and can not get
> > rid of this bug:
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.CollectionDescriptor.getFksToTh
> > isClass(Collec
> > > tionDescriptor.java:87)
> > > at
> > >
> > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getMtoNQu
> > ery(Persistenc
> > > eBrokerImpl.java:1762)
> > > at
> > >
> > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.retrieveC
> > ollection(Pers
> > > istenceBrokerImpl.java:873)
> > > at
> > >
> > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.retrieveC
> > ollections(Per
> > > sistenceBrokerImpl.java:941)
> > > at
> > >
> > org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResu
> > ltSet(RsIterat
> > > or.java:564)
> > >
> > > Are Vectors for n:m-relations no longer supported (the
> example uses
> > arrays).
> > > The CollectionDescriptor is not used at all to prepare the
> > mapping. It
> > seams
> > > to me that this is not correct. The repository.xml is
> > found, but in my
> > older
> > > version it took ojb some time to initialize. The new
> > version (rsp. my
> > > application) does not initialize at all.
> > >
> > > Help is very welcome.
> > >
> > > Best regards
> > >
> > > Boerries
> > >
> > > --
> > > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
>
>
> --------------------------------------------------------------
> --------------
> ----
>
>
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>