You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Piotr Kozak <pk...@pf.pl> on 2004/04/30 11:41:54 UTC

[Intake problem]

Hi,
I have problem with mapTo mechanism in intake.
When I do 
    #set ( $customerGroup = ${intake.customerGroup.mapTo($customer)} )
    $customerGroup.webPage.Key  have not properly value.
So then method group.setProperties(new Customer())
doesn't set parameters in a proper way.

My intake.xml looks:
<input-data basePackage="pl.poznan.put.cs.esds.">
    <group name="customerGroup" key="customerGroup" 
mapToObject="om.Customer">
               <field name="webPage" key="webPage" type="String" 
mapToProperty="webPage">
                    rules....
            </field>
    </group>
</input-data>

The class Customer is automatically generated by Torque and I can not 
see here the Retrievable interface. Is it necessary?

regards,
PK
        


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: [Intake problem]

Posted by David Demner <tu...@demner.com>.
Hi Piotr,

Your problem is almost certainly because you didn't implement the
Retrievable interface.  The java file created by Torque should be changed to
look something like:

----------
package blah.om;
import org.apache.torque.om.Persistent;
import org.apache.turbine.om.Retrievable;
public class Customer extends BaseCustomer
    implements Persistent, Retrievable {

    public String getQueryKey() {
        return "_0";
    }

    public void setQueryKey(String queryKey) {}
}
-----------

getQueryKey and setQueryKey are discussed in some length on the Intake
howto, so I won't go into them here.  Basically, if you have only one intake
group per object, it's sufficient to hardcode _0 as the QueryKey.

Good luck,

David


-----Original Message-----
From: Piotr Kozak [mailto:pkk@pf.pl] 
Sent: Friday April 30, 2004 2:42 AM
To: turbine-user@jakarta.apache.org
Subject: [Intake problem]


Hi,
I have problem with mapTo mechanism in intake.
When I do 
    #set ( $customerGroup = ${intake.customerGroup.mapTo($customer)} )
    $customerGroup.webPage.Key  have not properly value.
So then method group.setProperties(new Customer())
doesn't set parameters in a proper way.

My intake.xml looks:
<input-data basePackage="pl.poznan.put.cs.esds.">
    <group name="customerGroup" key="customerGroup" 
mapToObject="om.Customer">
               <field name="webPage" key="webPage" type="String" 
mapToProperty="webPage">
                    rules....
            </field>
    </group>
</input-data>

The class Customer is automatically generated by Torque and I can not 
see here the Retrievable interface. Is it necessary?

regards,
PK
        


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org