// license-header java merge-point // // This file can be safely modified. If deleted it will be regenerated. // Generated by Entity.vsl in andromda-ejb3-cartridge on 09/18/2014 16:56:07. // package org.andromda.test.howto11.a; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.Transient; /** * Autogenerated POJO EJB3 implementation class for Car. * * Add any manual implementation within this class. This class will NOT * be overwritten with incremental changes. * *
* TODO: Model Documentation for org.andromda.test.howto11.a.Car *
* */ @Entity @Table(name = "CAR") // Uncomment to enable entity listener for Car // @javax.persistence.EntityListeners({org.andromda.test.howto11.a.CarListener.class}) // Uncomment to enable caching for Car // @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.TRANSACTIONAL) @NamedQueries ({ @NamedQuery(name = "Car.findAll", query = "SELECT c FROM Car AS c"), @NamedQuery(name = "Car.findByType", query = "SELECT c from Car as c WHERE c.type = :type") }) public class Car extends CarEmbeddable implements Serializable, Comparable* Returns true if this car is current rented. *
*/ @Transient public boolean isRented() { // TODO put your implementation here. return false; } /** ** Returns true if all cars are currently rented. *
*/ @Transient public static boolean allCarsAreRented() { // TODO put your implementation here. return false; } // --------------- Lifecycle callbacks ----------------- /** * @see Comparable#compareTo */ @Override public int compareTo(Car o) { int cmp = 0; if (this.getId() != null) { cmp = this.getId().compareTo(o.getId()); } else { if (this.getSerial() != null) { cmp = (cmp != 0 ? cmp : this.getSerial().compareTo(o.getSerial())); } if (this.getName() != null) { cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); } if (this.getType() != null) { cmp = (cmp != 0 ? cmp : this.getType().compareTo(o.getType())); } } return cmp; } }