com.konakart.om
Class BaseCoupon

java.lang.Object
  extended by org.apache.torque.om.BaseObject
      extended by com.konakart.om.BaseCoupon
All Implemented Interfaces:
java.io.Serializable, org.apache.torque.om.Persistent
Direct Known Subclasses:
Coupon

public abstract class BaseCoupon
extends org.apache.torque.om.BaseObject

This class was autogenerated by Torque on: [Wed Jun 13 21:13:35 BST 2012] Object.vm template overriden for KonaKart You should not use this class directly. It should not even be extended all references should be to Coupon

See Also:
Serialized Form

Field Summary
protected  java.util.List collPromotionToCoupons
          Collection to store aggregation of collPromotionToCoupons
 
Fields inherited from class org.apache.torque.om.BaseObject
NEW_ID
 
Constructor Summary
BaseCoupon()
           
 
Method Summary
 void addPromotionToCoupon(PromotionToCoupon l)
          Method called to associate a PromotionToCoupon object to this object through the PromotionToCoupon foreign key attribute
 void addPromotionToCoupon(PromotionToCoupon l, java.sql.Connection con)
          Method called to associate a PromotionToCoupon object to this object through the PromotionToCoupon foreign key attribute using connection.
 Coupon copy()
          Makes a copy of this object.
 Coupon copy(boolean deepcopy)
          Makes a copy of this object.
 Coupon copy(boolean deepcopy, java.sql.Connection con)
          Makes a copy of this object using connection.
 Coupon copy(java.sql.Connection con)
          Makes a copy of this object using connection.
protected  Coupon copyInto(Coupon copyObj)
          Fills the copyObj with the contents of this object.
protected  Coupon copyInto(Coupon copyObj, boolean deepcopy)
          Fills the copyObj with the contents of this object.
protected  Coupon copyInto(Coupon copyObj, boolean deepcopy, java.sql.Connection con)
          Fills the copyObj with the contents of this object using connection.
protected  Coupon copyInto(Coupon copyObj, java.sql.Connection con)
          Fills the copyObj with the contents of this object using connection.
 java.lang.Object getByName(java.lang.String name)
          Retrieves a field from the object by field (Java) name passed in as a String.
 java.lang.Object getByPeerName(java.lang.String name)
          Retrieves a field from the object by name passed in as a String.
 java.lang.Object getByPosition(int pos)
          Retrieves a field from the object by Position as specified in the xml schema.
 java.lang.String getCouponCode()
          Get the CouponCode
 int getCouponId()
          Get the CouponId
 java.lang.String getCustom1()
          Get the Custom1
 java.lang.String getCustom2()
          Get the Custom2
 java.lang.String getCustom3()
          Get the Custom3
 java.lang.String getCustom4()
          Get the Custom4
 java.lang.String getCustom5()
          Get the Custom5
 java.util.Date getDateAdded()
          Get the DateAdded
 java.lang.String getDescription()
          Get the Description
static java.util.List<java.lang.String> getFieldNames()
          Generate a list of field names.
 java.util.Date getLastModified()
          Get the LastModified
 int getMaxUse()
          Get the MaxUse
 java.lang.String getName()
          Get the Name
 CouponPeer getPeer()
          returns a peer instance associated with this om.
 org.apache.torque.om.ObjectKey getPrimaryKey()
          returns an id that differentiates this object from others of its class.
 java.util.List getPromotionToCoupons()
          If this collection has already been initialized, returns the collection.
 java.util.List getPromotionToCoupons(java.sql.Connection con)
          If this collection has already been initialized, returns the collection.
 java.util.List getPromotionToCoupons(org.apache.torque.util.Criteria criteria)
          If this collection has already been initialized with an identical criteria, it returns the collection.
 java.util.List getPromotionToCoupons(org.apache.torque.util.Criteria criteria, java.sql.Connection con)
          If this collection has already been initialized with an identical criteria, it returns the collection.
protected  java.util.List getPromotionToCouponsJoinCoupon(org.apache.torque.util.Criteria criteria)
          If this collection has already been initialized with an identical criteria, it returns the collection.
 java.lang.String getStoreId()
          Get the StoreId
 org.apache.torque.map.TableMap getTableMap()
          Retrieves the TableMap object related to this Table data without compiler warnings of using getPeer().getTableMap().
 int getTimesUsed()
          Get the TimesUsed
protected  void initPromotionToCoupons()
          Temporary storage of collPromotionToCoupons to save a possible db hit in the event objects are add to the collection, but the complete collection is never requested.
 void save()
          Stores the object in the database.
 void save(java.sql.Connection con)
          Stores the object in the database.
 void save(java.lang.String dbName)
          Stores the object in the database.
 boolean setByName(java.lang.String name, java.lang.Object value)
          Set a field in the object by field (Java) name.
 boolean setByPeerName(java.lang.String name, java.lang.Object value)
          Set field values by Peer Field Name
 boolean setByPosition(int position, java.lang.Object value)
          Set field values by its position (zero based) in the XML schema.
 void setCouponCode(java.lang.String v)
          Set the value of CouponCode
 void setCouponId(int v)
          Set the value of CouponId
 void setCustom1(java.lang.String v)
          Set the value of Custom1
 void setCustom2(java.lang.String v)
          Set the value of Custom2
 void setCustom3(java.lang.String v)
          Set the value of Custom3
 void setCustom4(java.lang.String v)
          Set the value of Custom4
 void setCustom5(java.lang.String v)
          Set the value of Custom5
 void setDateAdded(java.util.Date v)
          Set the value of DateAdded
 void setDescription(java.lang.String v)
          Set the value of Description
 void setLastModified(java.util.Date v)
          Set the value of LastModified
 void setMaxUse(int v)
          Set the value of MaxUse
 void setName(java.lang.String v)
          Set the value of Name
 void setPrimaryKey(org.apache.torque.om.ObjectKey key)
          Set the PrimaryKey using ObjectKey.
 void setPrimaryKey(java.lang.String key)
          Set the PrimaryKey using a String.
 void setStoreId(java.lang.String v)
          Set the value of StoreId
 void setTimesUsed(int v)
          Set the value of TimesUsed
 java.lang.String toString()
           
 
Methods inherited from class org.apache.torque.om.BaseObject
equals, equals, getLog, hashCode, isModified, isNew, resetModified, setModified, setNew, setPrimaryKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

collPromotionToCoupons

protected java.util.List collPromotionToCoupons
Collection to store aggregation of collPromotionToCoupons

Constructor Detail

BaseCoupon

public BaseCoupon()
Method Detail

getCouponId

public int getCouponId()
Get the CouponId

Returns:
int

setCouponId

public void setCouponId(int v)
                 throws org.apache.torque.TorqueException
Set the value of CouponId

Parameters:
v - new value
Throws:
org.apache.torque.TorqueException

getStoreId

public java.lang.String getStoreId()
Get the StoreId

Returns:
String

setStoreId

public void setStoreId(java.lang.String v)
Set the value of StoreId

Parameters:
v - new value

getCouponCode

public java.lang.String getCouponCode()
Get the CouponCode

Returns:
String

setCouponCode

public void setCouponCode(java.lang.String v)
Set the value of CouponCode

Parameters:
v - new value

getName

public java.lang.String getName()
Get the Name

Returns:
String

setName

public void setName(java.lang.String v)
Set the value of Name

Parameters:
v - new value

getDescription

public java.lang.String getDescription()
Get the Description

Returns:
String

setDescription

public void setDescription(java.lang.String v)
Set the value of Description

Parameters:
v - new value

getMaxUse

public int getMaxUse()
Get the MaxUse

Returns:
int

setMaxUse

public void setMaxUse(int v)
Set the value of MaxUse

Parameters:
v - new value

getTimesUsed

public int getTimesUsed()
Get the TimesUsed

Returns:
int

setTimesUsed

public void setTimesUsed(int v)
Set the value of TimesUsed

Parameters:
v - new value

getCustom1

public java.lang.String getCustom1()
Get the Custom1

Returns:
String

setCustom1

public void setCustom1(java.lang.String v)
Set the value of Custom1

Parameters:
v - new value

getCustom2

public java.lang.String getCustom2()
Get the Custom2

Returns:
String

setCustom2

public void setCustom2(java.lang.String v)
Set the value of Custom2

Parameters:
v - new value

getCustom3

public java.lang.String getCustom3()
Get the Custom3

Returns:
String

setCustom3

public void setCustom3(java.lang.String v)
Set the value of Custom3

Parameters:
v - new value

getCustom4

public java.lang.String getCustom4()
Get the Custom4

Returns:
String

setCustom4

public void setCustom4(java.lang.String v)
Set the value of Custom4

Parameters:
v - new value

getCustom5

public java.lang.String getCustom5()
Get the Custom5

Returns:
String

setCustom5

public void setCustom5(java.lang.String v)
Set the value of Custom5

Parameters:
v - new value

getLastModified

public java.util.Date getLastModified()
Get the LastModified

Returns:
Date

setLastModified

public void setLastModified(java.util.Date v)
Set the value of LastModified

Parameters:
v - new value

getDateAdded

public java.util.Date getDateAdded()
Get the DateAdded

Returns:
Date

setDateAdded

public void setDateAdded(java.util.Date v)
Set the value of DateAdded

Parameters:
v - new value

initPromotionToCoupons

protected void initPromotionToCoupons()
Temporary storage of collPromotionToCoupons to save a possible db hit in the event objects are add to the collection, but the complete collection is never requested.


addPromotionToCoupon

public void addPromotionToCoupon(PromotionToCoupon l)
                          throws org.apache.torque.TorqueException
Method called to associate a PromotionToCoupon object to this object through the PromotionToCoupon foreign key attribute

Parameters:
l - PromotionToCoupon
Throws:
org.apache.torque.TorqueException

addPromotionToCoupon

public void addPromotionToCoupon(PromotionToCoupon l,
                                 java.sql.Connection con)
                          throws org.apache.torque.TorqueException
Method called to associate a PromotionToCoupon object to this object through the PromotionToCoupon foreign key attribute using connection.

Parameters:
l - PromotionToCoupon
Throws:
org.apache.torque.TorqueException

getPromotionToCoupons

public java.util.List getPromotionToCoupons()
                                     throws org.apache.torque.TorqueException
If this collection has already been initialized, returns the collection. Otherwise returns the results of getPromotionToCoupons(new Criteria())

Returns:
the collection of associated objects
Throws:
org.apache.torque.TorqueException

getPromotionToCoupons

public java.util.List getPromotionToCoupons(org.apache.torque.util.Criteria criteria)
                                     throws org.apache.torque.TorqueException
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Coupon has previously been saved, it will retrieve related PromotionToCoupons from storage. If this Coupon is new, it will return an empty collection or the current collection, the criteria is ignored on a new object.

Throws:
org.apache.torque.TorqueException

getPromotionToCoupons

public java.util.List getPromotionToCoupons(java.sql.Connection con)
                                     throws org.apache.torque.TorqueException
If this collection has already been initialized, returns the collection. Otherwise returns the results of getPromotionToCoupons(new Criteria(),Connection) This method takes in the Connection also as input so that referenced objects can also be obtained using a Connection that is taken as input

Throws:
org.apache.torque.TorqueException

getPromotionToCoupons

public java.util.List getPromotionToCoupons(org.apache.torque.util.Criteria criteria,
                                            java.sql.Connection con)
                                     throws org.apache.torque.TorqueException
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Coupon has previously been saved, it will retrieve related PromotionToCoupons from storage. If this Coupon is new, it will return an empty collection or the current collection, the criteria is ignored on a new object. This method takes in the Connection also as input so that referenced objects can also be obtained using a Connection that is taken as input

Throws:
org.apache.torque.TorqueException

getPromotionToCouponsJoinCoupon

protected java.util.List getPromotionToCouponsJoinCoupon(org.apache.torque.util.Criteria criteria)
                                                  throws org.apache.torque.TorqueException
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Coupon is new, it will return an empty collection; or if this Coupon has previously been saved, it will retrieve related PromotionToCoupons from storage. This method is protected by default in order to keep the public api reasonable. You can provide public methods for those you actually need in Coupon.

Throws:
org.apache.torque.TorqueException

getFieldNames

public static java.util.List<java.lang.String> getFieldNames()
Generate a list of field names.

Returns:
a list of field names

getByName

public java.lang.Object getByName(java.lang.String name)
Retrieves a field from the object by field (Java) name passed in as a String.

Overrides:
getByName in class org.apache.torque.om.BaseObject
Parameters:
name - field name
Returns:
value

setByName

public boolean setByName(java.lang.String name,
                         java.lang.Object value)
                  throws org.apache.torque.TorqueException,
                         java.lang.IllegalArgumentException
Set a field in the object by field (Java) name.

Overrides:
setByName in class org.apache.torque.om.BaseObject
Parameters:
name - field name
value - field value
Returns:
True if value was set, false if not (invalid name / protected field).
Throws:
java.lang.IllegalArgumentException - if object type of value does not match field object type.
org.apache.torque.TorqueException - If a problem occurs with the set[Field] method.

getByPeerName

public java.lang.Object getByPeerName(java.lang.String name)
Retrieves a field from the object by name passed in as a String. The String must be one of the static Strings defined in this Class' Peer.

Overrides:
getByPeerName in class org.apache.torque.om.BaseObject
Parameters:
name - peer name
Returns:
value

setByPeerName

public boolean setByPeerName(java.lang.String name,
                             java.lang.Object value)
                      throws org.apache.torque.TorqueException,
                             java.lang.IllegalArgumentException
Set field values by Peer Field Name

Overrides:
setByPeerName in class org.apache.torque.om.BaseObject
Parameters:
name - field name
value - field value
Returns:
True if value was set, false if not (invalid name / protected field).
Throws:
java.lang.IllegalArgumentException - if object type of value does not match field object type.
org.apache.torque.TorqueException - If a problem occurs with the set[Field] method.

getByPosition

public java.lang.Object getByPosition(int pos)
Retrieves a field from the object by Position as specified in the xml schema. Zero-based.

Overrides:
getByPosition in class org.apache.torque.om.BaseObject
Parameters:
pos - position in xml schema
Returns:
value

setByPosition

public boolean setByPosition(int position,
                             java.lang.Object value)
                      throws org.apache.torque.TorqueException,
                             java.lang.IllegalArgumentException
Set field values by its position (zero based) in the XML schema.

Overrides:
setByPosition in class org.apache.torque.om.BaseObject
Parameters:
position - The field position
value - field value
Returns:
True if value was set, false if not (invalid position / protected field).
Throws:
java.lang.IllegalArgumentException - if object type of value does not match field object type.
org.apache.torque.TorqueException - If a problem occurs with the set[Field] method.

save

public void save()
          throws java.lang.Exception
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed.

Specified by:
save in interface org.apache.torque.om.Persistent
Specified by:
save in class org.apache.torque.om.BaseObject
Throws:
java.lang.Exception

save

public void save(java.lang.String dbName)
          throws org.apache.torque.TorqueException
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed. Note: this code is here because the method body is auto-generated conditionally and therefore needs to be in this file instead of in the super class, BaseObject.

Specified by:
save in interface org.apache.torque.om.Persistent
Specified by:
save in class org.apache.torque.om.BaseObject
Parameters:
dbName -
Throws:
org.apache.torque.TorqueException

save

public void save(java.sql.Connection con)
          throws org.apache.torque.TorqueException
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed. This method is meant to be used as part of a transaction, otherwise use the save() method and the connection details will be handled internally

Specified by:
save in interface org.apache.torque.om.Persistent
Specified by:
save in class org.apache.torque.om.BaseObject
Parameters:
con -
Throws:
org.apache.torque.TorqueException

setPrimaryKey

public void setPrimaryKey(org.apache.torque.om.ObjectKey key)
                   throws org.apache.torque.TorqueException
Set the PrimaryKey using ObjectKey.

Specified by:
setPrimaryKey in interface org.apache.torque.om.Persistent
Overrides:
setPrimaryKey in class org.apache.torque.om.BaseObject
Parameters:
key - couponId ObjectKey
Throws:
org.apache.torque.TorqueException

setPrimaryKey

public void setPrimaryKey(java.lang.String key)
                   throws org.apache.torque.TorqueException
Set the PrimaryKey using a String.

Specified by:
setPrimaryKey in interface org.apache.torque.om.Persistent
Overrides:
setPrimaryKey in class org.apache.torque.om.BaseObject
Parameters:
key -
Throws:
org.apache.torque.TorqueException

getPrimaryKey

public org.apache.torque.om.ObjectKey getPrimaryKey()
returns an id that differentiates this object from others of its class.

Specified by:
getPrimaryKey in interface org.apache.torque.om.Persistent
Overrides:
getPrimaryKey in class org.apache.torque.om.BaseObject

copy

public Coupon copy()
            throws org.apache.torque.TorqueException
Makes a copy of this object. It creates a new object filling in the simple attributes. It then fills all the association collections and sets the related objects to isNew=true.

Returns:
a Coupon object
Throws:
org.apache.torque.TorqueException

copy

public Coupon copy(java.sql.Connection con)
            throws org.apache.torque.TorqueException
Makes a copy of this object using connection. It creates a new object filling in the simple attributes. It then fills all the association collections and sets the related objects to isNew=true.

Parameters:
con - the database connection to read associated objects.
Returns:
a Coupon object
Throws:
org.apache.torque.TorqueException

copy

public Coupon copy(boolean deepcopy)
            throws org.apache.torque.TorqueException
Makes a copy of this object. It creates a new object filling in the simple attributes. If the parameter deepcopy is true, it then fills all the association collections and sets the related objects to isNew=true.

Parameters:
deepcopy - whether to copy the associated objects.
Returns:
a Coupon object
Throws:
org.apache.torque.TorqueException

copy

public Coupon copy(boolean deepcopy,
                   java.sql.Connection con)
            throws org.apache.torque.TorqueException
Makes a copy of this object using connection. It creates a new object filling in the simple attributes. If the parameter deepcopy is true, it then fills all the association collections and sets the related objects to isNew=true.

Parameters:
deepcopy - whether to copy the associated objects.
con - the database connection to read associated objects.
Returns:
a Coupon object
Throws:
org.apache.torque.TorqueException

copyInto

protected Coupon copyInto(Coupon copyObj)
                   throws org.apache.torque.TorqueException
Fills the copyObj with the contents of this object. The associated objects are also copied and treated as new objects.

Parameters:
copyObj - the object to fill.
Throws:
org.apache.torque.TorqueException

copyInto

protected Coupon copyInto(Coupon copyObj,
                          java.sql.Connection con)
                   throws org.apache.torque.TorqueException
Fills the copyObj with the contents of this object using connection. The associated objects are also copied and treated as new objects.

Parameters:
copyObj - the object to fill.
con - the database connection to read associated objects.
Throws:
org.apache.torque.TorqueException

copyInto

protected Coupon copyInto(Coupon copyObj,
                          boolean deepcopy)
                   throws org.apache.torque.TorqueException
Fills the copyObj with the contents of this object. If deepcopy is true, The associated objects are also copied and treated as new objects.

Parameters:
copyObj - the object to fill.
deepcopy - whether the associated objects should be copied.
Throws:
org.apache.torque.TorqueException

copyInto

protected Coupon copyInto(Coupon copyObj,
                          boolean deepcopy,
                          java.sql.Connection con)
                   throws org.apache.torque.TorqueException
Fills the copyObj with the contents of this object using connection. If deepcopy is true, The associated objects are also copied and treated as new objects.

Parameters:
copyObj - the object to fill.
deepcopy - whether the associated objects should be copied.
con - the database connection to read associated objects.
Returns:
a Coupon object
Throws:
org.apache.torque.TorqueException

getPeer

public CouponPeer getPeer()
returns a peer instance associated with this om. Since Peer classes are not to have any instance attributes, this method returns the same instance for all member of this class. The method could therefore be static, but this would prevent one from overriding the behavior.

Returns:
The CouponPeer object.

getTableMap

public org.apache.torque.map.TableMap getTableMap()
                                           throws org.apache.torque.TorqueException
Retrieves the TableMap object related to this Table data without compiler warnings of using getPeer().getTableMap().

Overrides:
getTableMap in class org.apache.torque.om.BaseObject
Returns:
The associated TableMap object.
Throws:
org.apache.torque.TorqueException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 DS Data Systems UK Ltd.