OrderImpl.java :  » Database-ORM » jaxor-3.5 » net » sourceforge » jaxor » example » domain » Java Open Source

Java Open Source » Database ORM » jaxor 3.5 
jaxor 3.5 » net » sourceforge » jaxor » example » domain » OrderImpl.java
package net.sourceforge.jaxor.example.domain;

import net.sourceforge.jaxor.example.Money;

/**
 * This source file demonstrates the 'impl' attribute of a generated entity. When the 'impl' attribute is specified on an entity
 * jaxor generates an abstract base class. The impl attribute specifies the concreate implementation of this abstract class.
 * This class is coded by hand, so it can extend the base abstract class with domain specific methods, as demonstrated here. Any
 * methods added to the 'impl' class will be parsed during build time and added to the interface definitions automatically.
 */
public class OrderImpl extends OrdersBase {

    public Money getOrderTotal() {
        return getEquipmentCost().add(getSalesTax().add(getShippingCharge()));
    }

    public Money subtractFromTotal(Money amount) {
        return getOrderTotal().subtract(amount);
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.