Pretty simple I think:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE descriptor-repository PUBLIC "-//Apache Software Foundation//DTD
OJB Repository//EN" "repository.dtd">
<descriptor-repository version="1.0" isolation-level="read-uncommitted">
<jdbc-connection-descriptor jcd-alias="default" default-connection="true"
platform="MySQL" jdbc-level="3.0" driver="org.gjt.mm.mysql.Driver"
protocol="jdbc" subprotocol="mysql"
dbalias="//localhost:3306/dtofficemanager" username="root" password="jack1e"
eager-release="false" batch-mode="false" useAutoCommit="2"
ignoreAutoCommitExceptions="false">
<connection-pool maxActive="21" validationQuery=""/>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerMySQLImpl">
<attribute attribute-name="autoNaming" attribute-value="false"/>
<attribute attribute-name="grabSize" attribute-value="20"/>
</sequence-manager>
</jdbc-connection-descriptor>
<class-descriptor class="com.datatrio.officemanager.User" proxy="dynamic"
table="USER">
<field-descriptor name="ID" primarykey="true" autoincrement="true"
column="ID" jdbc-type="INTEGER" access="readonly"/>
<field-descriptor name="firstName" nullable="false" column="FIRSTNAME"
jdbc-type="VARCHAR"/>
<field-descriptor name="lastName" nullable="false" column="LASTNAME"
jdbc-type="VARCHAR"/>
<field-descriptor name="userName" nullable="false" column="USERNAME"
jdbc-type="VARCHAR"/>
<field-descriptor name="password" nullable="false" column="PASSWORD"
jdbc-type="VARCHAR"/>
<field-descriptor name="emailAddress" nullable="false"
column="EMAILADDRESS" jdbc-type="VARCHAR"/>
<field-descriptor name="phone" column="PHONE" jdbc-type="VARCHAR"/>
<field-descriptor name="roleID" primarykey="true" nullable="false"
column="ROLEID" jdbc-type="INTEGER"/>
<field-descriptor name="disabled" nullable="false" column="DISABLED"
jdbc-type="CHAR"/>
</class-descriptor>
<class-descriptor class="com.datatrio.officemanager.Role" proxy="dynamic"
table="ROLE">
<field-descriptor name="ID" primarykey="true" autoincrement="true"
column="ID" jdbc-type="INTEGER" access="readonly"/>
<field-descriptor name="name" nullable="false" column="NAME"
jdbc-type="VARCHAR"/>
<field-descriptor name="description" column="DESCRIPTION"
jdbc-type="VARCHAR"/>
</class-descriptor>
</descriptor-repository>
-----Original Message-----
From: Antonio Gallardo [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 25, 2003 10:36 PM
To: [EMAIL PROTECTED]
Subject: Re: Collection returned from query empty
Hi JD:
Can you post the repository.xml that are you using?
Best Regards,
Antonio Gallardo
JD Daniels dijo:
>
> I am starting out modifying the tutorial5 from the distrubution.... Add,
> edit and delete all work great, but listall is acting funny.... The
> records are there, but do not get returned. Setting RsIterator logging
> to DEBUG shows the results are getting selected from the rdbms, but the
> returned Collection is always empty....
>
> Java:
> try
> {
>
> manager.currentTransaction().begin();
> Query query = manager.newQuery(Role.class);
>
> Collection allRoles = (Collection)query.execute();
> System.out.println("Collection Returned Is Empty: " +
> allRoles.isEmpty());
>
> java.util.Iterator iter = allRoles.iterator();
> System.out.println("Currently " + allRoles.size() + " Roles");
>
> manager.currentTransaction().commit();
> }
> catch (Throwable t)
> {
> t.printStackTrace();
> }
> finally
> {
> manager.close();
> }
>
> Output:
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> true
> [org.apache.ojb.broker.accesslayer.RsIterator] DEBUG: hasNext() -> false
> Collection Returned Is Empty: true
> Currently 0 Roles
>
>
>
> --------------------------------------------------------------------- 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]