ibspan.ecap.merchant.shopdecisions.dataaccess
Class DataModificationService

java.lang.Object
  extended by ibspan.ecap.merchant.shopdecisions.dataaccess.DataModificationService

public class DataModificationService
extends java.lang.Object

A service responsible for inserting and modifying the data in the data warehouse. Singleton.

Author:
Micha³ Drozdowicz

Method Summary
 int getDateKey(java.util.Date date)
           
 DemandFact getDemandFact(int dateKey, int productKey)
           
static DataModificationService getInstance()
          Gets the instance of the DataAccessModule.
 int getProductKey(java.lang.String productId)
           
 SalesFact getSalesFact(int negotiationId)
           
 int getStrategyKey(java.lang.String globalId)
           
 SuppliesFact getSuppliesFact(int wholesalerKey, int productKey, int orderDateKey, int orderTimeKey, int deliveryDateKey, int deliveryTimeKey)
           
 int getTemplateKey(java.lang.String globalId)
           
 int getTimeKey(java.util.Date time)
           
 int getWholesalerKey(java.lang.String globalId)
           
 int insertDate(DateEntity date)
           
 void insertDemandFact(DemandFact fact)
           
 void insertForecastFact(ForecastFact fact)
           
 int insertProduct(ProductEntity product)
           
 void insertSalesFact(SalesFact fact)
           
 int insertStrategy(StrategyEntity entity)
           
 void insertSuppliesFact(SuppliesFact fact)
           
 int insertTemplate(TemplateEntity entity)
           
 int insertTime(TimeEntity time)
           
 int insertWholesaler(WholesalerEntity entity)
           
 void updateDemandFact(DemandFact fact)
           
 void updateSalesFact(SalesFact fact)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DataModificationService getInstance()
Gets the instance of the DataAccessModule.

Returns:
the instance

getDateKey

public int getDateKey(java.util.Date date)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

insertDate

public int insertDate(DateEntity date)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getTimeKey

public int getTimeKey(java.util.Date time)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

insertTime

public int insertTime(TimeEntity time)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getProductKey

public int getProductKey(java.lang.String productId)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

insertProduct

public int insertProduct(ProductEntity product)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getWholesalerKey

public int getWholesalerKey(java.lang.String globalId)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

insertWholesaler

public int insertWholesaler(WholesalerEntity entity)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

getStrategyKey

public int getStrategyKey(java.lang.String globalId)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

insertStrategy

public int insertStrategy(StrategyEntity entity)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getTemplateKey

public int getTemplateKey(java.lang.String globalId)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

insertTemplate

public int insertTemplate(TemplateEntity entity)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getSalesFact

public SalesFact getSalesFact(int negotiationId)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

insertSalesFact

public void insertSalesFact(SalesFact fact)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

updateSalesFact

public void updateSalesFact(SalesFact fact)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

getSuppliesFact

public SuppliesFact getSuppliesFact(int wholesalerKey,
                                    int productKey,
                                    int orderDateKey,
                                    int orderTimeKey,
                                    int deliveryDateKey,
                                    int deliveryTimeKey)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

insertSuppliesFact

public void insertSuppliesFact(SuppliesFact fact)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getDemandFact

public DemandFact getDemandFact(int dateKey,
                                int productKey)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

insertDemandFact

public void insertDemandFact(DemandFact fact)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

updateDemandFact

public void updateDemandFact(DemandFact fact)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

insertForecastFact

public void insertForecastFact(ForecastFact fact)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException