Hello,
There was a thread in the archive about "Map two classes to One table" and
my problem seems to be connected to it, but I do only xml mapping at the
moment, JDO is to come later.
About our task:
We have an interface for price informations as
public interface IPrice {
public double getAmount();
public void setAmount(double pAmount);
...}
And a Price class implementing this iface
public class Price implements IPrice {
private double m_Amount;
private String m_Currency;
public double getAmount() {
return m_Amount;
}
public void setAmount(double pAmount) {
m_Amount = pAmount;
}
...}
And there is an Offer which has a Price, but in general should not give info
about the implementation of Price, so it has getter/setter with ifaces
public class Offer extends GenericOffer implements IOffer {
private Price m_PriceTotal = null;
public IPrice getPriceTotal() {
return (IPrice)m_PriceTotal;
}
public void setPriceTotal(IPrice priceTotal) {
m_PriceTotal = (Price)priceTotal;
}
...}
We would like to have the price info together with all Offer data, at the
same xml level (and later in the same db table).
Our mapping file (section of Offer) is like
...
<field name="PriceTotal.Amount" type="double">
<bind-xml name="PriceTotal.Amount" node="element">
</field>
<field name="PriceTotal.Currency" type="string">
<bind-xml name="PriceTotal.Currency"
node="element"/>
</field>
...
Now the problem:
With the situation described above I get
org.exolab.castor.mapping.MappingException: The method getAmount in class
IPrice is not accessible -- the method must be public and not static.
And if I get rid of the interface IPrice (so everything uses directly Price
class) then everyting (xml marhalling+unmarshalling) works fine.
Is there a bug in Castor or do we make a mistake somewhere?
Thanks for any help,
Peter
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev