These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Not cascading on insert and @Generated(Gen...) not inserting
PostPosted: Fri Oct 03, 2008 8:22 pm 
Beginner
Beginner

Joined: Thu Feb 28, 2008 11:53 am
Posts: 23
So basically I have 2 objects I want to persist a Log object and a Request object however they do not cascade when I save the owner (Request) so I have to save them independently which I shouldn't have to. Seceondly my automatic timestamp insert doesn't insert anything the column just inserts null and not the timestamp, so that doesn't work, thirdly why does the log show the generated sql twice, this puzzles me can anyone shed some light on these.

The timestamp code looks lik this
Code:
@Temporal(TemporalType.DATE)
    @Column(name="last_update", updatable = false, insertable = false)
    @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.ALWAYS)
public Date getCreated(){
   return created;
}


The persisting code that doesn't work is below along with the logs and the objects' code
Code:
            log.setCollectionId(1L);
            log.setFromState(1L);
            log.setToState(2L);
            log.setMessage("message");
            log.setUserid(userid);
            bean.addLog(log);
            bean.setProdGrp(productGroup);
            bean.setInco(incoTerms);
            bean.setInvProdType(productType);
           
            Serializable s = bmsRequestDAO.save(bean);


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.3.1.GA

Mapping documents: Using annotations 3.1.0.GA

Code between sessionFactory.openSession() and session.close(): Using HibernateTemplate

Full stack trace of any exception that occurs: No exception

Name and version of the database you are using: Oracle 10g XE

The generated SQL (show_sql=true):
select
request_id_generator.nextval
from
dual>
Hibernate:
select
request_id_generator.nextval
from
dual
2008-10-02 11:33:07,904 DEBUG [org.springframework.orm.hibernate3.HibernateTemplate] - <Not closing pre-bound Hibernate Session after HibernateTemplate>
2008-10-02 11:33:07,904 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Triggering beforeCommit synchronization>
2008-10-02 11:33:07,904 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Triggering beforeCompletion synchronization>
2008-10-02 11:33:07,904 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Initiating transaction commit>
2008-10-02 11:33:07,982 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@19b7aeb]>
2008-10-02 11:33:08,014 DEBUG [org.hibernate.SQL] - <
insert
into
tb_transfer_price_request
(buying_lc, buying_fx_rate, buying_location, discount_lcd, discount_pct, discount_usd, duty_pct, duty_lc, duty_usd, freight_insurance_lc, freight_insurance_pct, freight_insurance_usd, fx_rate_period, local_gross_margin_lc, local_gross_margin_lc_pct, local_gross_margin_usd_pct, local_gross_margin_usd, in_market_price_lc, in_market_price_usd, inco_terms_id, invoice_point_currency, invoice_point_fx_rate, inv_local_gross_margin_pct, invoiced_src, transfer_type, invoiced_sap_code, invoice_point, total_landed_cost_lc, total_landed_cost_usd, total_local_cost_lc, total_local_cost_usd, local_value_added_lc, local_value_added_usd, local_value_added_desc, marketed_src, marketed_sap_code, net_in_market_price_usd, net_in_market_price_lc, other_lc, other_desc, other_usd, product_group_id, ship_to_destination, xfer_price_2_market_src_lc, xfer_price_2_market_src_usd, transfer_price_lc, transfer_price_usd, utilization_factor_lc, version, volume_curr_yr, volume_curr_yr_plus_two, volume_curr_yr_plus_one, request_type, id)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'BMS', ?)>
Hibernate:
insert
into
tb_transfer_price_request
(buying_lc, buying_fx_rate, buying_location, discount_lcd, discount_pct, discount_usd, duty_pct, duty_lc, duty_usd, freight_insurance_lc, freight_insurance_pct, freight_insurance_usd, fx_rate_period, local_gross_margin_lc, local_gross_margin_lc_pct, local_gross_margin_usd_pct, local_gross_margin_usd, in_market_price_lc, in_market_price_usd, inco_terms_id, invoice_point_currency, invoice_point_fx_rate, inv_local_gross_margin_pct, invoiced_src, transfer_type, invoiced_sap_code, invoice_point, total_landed_cost_lc, total_landed_cost_usd, total_local_cost_lc, total_local_cost_usd, local_value_added_lc, local_value_added_usd, local_value_added_desc, marketed_src, marketed_sap_code, net_in_market_price_usd, net_in_market_price_lc, other_lc, other_desc, other_usd, product_group_id, ship_to_destination, xfer_price_2_market_src_lc, xfer_price_2_market_src_usd, transfer_price_lc, transfer_price_usd, utilization_factor_lc, version, volume_curr_yr, volume_curr_yr_plus_two, volume_curr_yr_plus_one, request_type, id)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'BMS', ?)
2008-10-02 11:33:08,279 DEBUG [org.hibernate.SQL] - <
select
bmsrequest_.created as created0_,
bmsrequest_.last_update as last31_0_
from
tb_transfer_price_request bmsrequest_
where
bmsrequest_.id=?>
Hibernate:
select
bmsrequest_.created as created0_,
bmsrequest_.last_update as last31_0_
from
tb_transfer_price_request bmsrequest_
where
bmsrequest_.id=?
2008-10-02 11:33:08,295 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Triggering afterCommit synchronization>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Triggering afterCompletion synchronization>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Clearing transaction synchronization>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Removed value [org.springframework.jdbc.datasource.ConnectionHolder@154bb1] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@e964fe] from thread [http-8085-5]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Not closing pre-bound Hibernate Session [org.hibernate.impl.SessionImpl@19b7aeb] after transaction>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] - <Adding transactional method [save] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Retrieved value [org.springframework.orm.hibernate3.SessionHolder@691ccf] for key [org.hibernate.impl.SessionFactoryImpl@16523ab] bound to thread [http-8085-5]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Found thread-bound Session [org.hibernate.impl.SessionImpl@19b7aeb] for Hibernate transaction>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@78b73f]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Creating new transaction with name [net.taxstream.atps.hibernate.DAO.GenericDAO.save]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@19b7aeb]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Exposing Hibernate transaction as JDBC transaction [jdbc:oracle:thin:@localhost:1521:xe, UserName=HIBERNATE2, Oracle JDBC driver]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Bound value [org.springframework.jdbc.datasource.ConnectionHolder@146b158] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@e964fe] to thread [http-8085-5]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Initializing transaction synchronization>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Retrieved value [org.springframework.orm.hibernate3.SessionHolder@691ccf] for key [org.hibernate.impl.SessionFactoryImpl@16523ab] bound to thread [http-8085-5]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - <Retrieved value [org.springframework.orm.hibernate3.SessionHolder@691ccf] for key [org.hibernate.impl.SessionFactoryImpl@16523ab] bound to thread [http-8085-5]>
2008-10-02 11:33:08,389 DEBUG [org.springframework.orm.hibernate3.HibernateTemplate] - <Found thread-bound Session for HibernateTemplate>
2008-10-02 11:33:08,389 DEBUG [org.hibernate.SQL] - <
select
log_id_generator.nextval
from
dual>
Hibernate:
select
log_id_generator.nextval
from
dual
2008-10-02 11:33:08,404 DEBUG [org.springframework.orm.hibernate3.HibernateTemplate] - <Not closing pre-bound Hibernate Session after HibernateTemplate>
2008-10-02 11:33:08,404 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Triggering beforeCommit synchronization>
2008-10-02 11:33:08,404 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Triggering beforeCompletion synchronization>
2008-10-02 11:33:08,404 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Initiating transaction commit>
2008-10-02 11:33:08,498 DEBUG [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@19b7aeb]>
2008-10-02 11:33:08,498 DEBUG [org.hibernate.SQL] - <
insert
into
tb_ctransition_logs
(collection_id, from_cstate_id, message, request_id, to_cstate_id, user_id, id)
values
(?, ?, ?, ?, ?, ?, ?)>
Hibernate:
insert
into
tb_ctransition_logs
(collection_id, from_cstate_id, message, request_id, to_cstate_id, user_id, id)
values
(?, ?, ?, ?, ?, ?, ?)
2008-10-02 11:33:08,545 DEBUG [org.hibernate.SQL] - <
select
transition_.transition_date as transition6_3_
from
tb_ctransition_logs transition_
where
transition_.id=?>
Hibernate:
select
transition_.transition_date as transition6_3_
from
tb_ctransition_logs transition_
where
transition_.id=?
2008-10-02 11:33:08,623 DEBUG [org.hibernate.SQL] - <
update
tb_transfer_price_request
set
buying_lc=?,
buying_fx_rate=?,
buying_location=?,
discount_lcd=?,
discount_pct=?,
discount_usd=?,
duty_pct=?,
duty_lc=?,
duty_usd=?,
freight_insurance_lc=?,
freight_insurance_pct=?,
freight_insurance_usd=?,
fx_rate_period=?,
local_gross_margin_lc=?,
local_gross_margin_lc_pct=?,
local_gross_margin_usd_pct=?,
local_gross_margin_usd=?,
in_market_price_lc=?,
in_market_price_usd=?,
inco_terms_id=?,
invoice_point_currency=?,
invoice_point_fx_rate=?,
inv_local_gross_margin_pct=?,
invoiced_src=?,
transfer_type=?,
invoiced_sap_code=?,
invoice_point=?,
total_landed_cost_lc=?,
total_landed_cost_usd=?,
total_local_cost_lc=?,
total_local_cost_usd=?,
local_value_added_lc=?,
local_value_added_usd=?,
local_value_added_desc=?,
marketed_src=?,
marketed_sap_code=?,
net_in_market_price_usd=?,
net_in_market_price_lc=?,
other_lc=?,
other_desc=?,
other_usd=?,
product_group_id=?,
ship_to_destination=?,

xfer_price_2_market_src_lc=?,
xfer_price_2_market_src_usd=?,
transfer_price_lc=?,
transfer_price_usd=?,
utilization_factor_lc=?,
version=?,
volume_curr_yr=?,
volume_curr_yr_plus_two=?,
volume_curr_yr_plus_one=?
where
id=?
and version=?>
Hibernate:
update
tb_transfer_price_request
set
buying_lc=?,
buying_fx_rate=?,
buying_location=?,
discount_lcd=?,
discount_pct=?,
discount_usd=?,
duty_pct=?,
duty_lc=?,
duty_usd=?,
freight_insurance_lc=?,
freight_insurance_pct=?,
freight_insurance_usd=?,
fx_rate_period=?,
local_gross_margin_lc=?,
local_gross_margin_lc_pct=?,
local_gross_margin_usd_pct=?,
local_gross_margin_usd=?,
in_market_price_lc=?,
in_market_price_usd=?,
inco_terms_id=?,
invoice_point_currency=?,
invoice_point_fx_rate=?,
inv_local_gross_margin_pct=?,
invoiced_src=?,
transfer_type=?,
invoiced_sap_code=?,
invoice_point=?,
total_landed_cost_lc=?,
total_landed_cost_usd=?,
total_local_cost_lc=?,
total_local_cost_usd=?,
local_value_added_lc=?,
local_value_added_usd=?,
local_value_added_desc=?,
marketed_src=?,
marketed_sap_code=?,
net_in_market_price_usd=?,
net_in_market_price_lc=?,
other_lc=?,
other_desc=?,
other_usd=?,
product_group_id=?,
ship_to_destination=?,
xfer_price_2_market_src_lc=?,
xfer_price_2_market_src_usd=?,
transfer_price_lc=?,
transfer_price_usd=?,
utilization_factor_lc=?,
version=?,
volume_curr_yr=?,
volume_curr_yr_plus_two=?,
volume_curr_yr_plus_one=?
where
id=?
and version=?
2008-10-02 11:33:08,748 DEBUG [org.hibernate.SQL] - <
select
bmsrequest_.last_update as last31_0_
from
tb_transfer_price_request bmsrequest_
where
bmsrequest_.id=?>
Hibernate:
select
bmsrequest_.last_update as last31_0_
from
tb_transfer_price_request bmsrequest_
where
bmsrequest_.id=?



Debug level Hibernate log excerpt: DEBUG


Problems with Session and transaction handling? None

Read this: http://hibernate.org/42.html

My Log object:
Code:
@Entity
@Table(name="tb_ctransition_logs")
public class TransitionsLog implements Serializable{
   
    private Long id;
    private Long collectionId;
    private Long fromState;
    private Long toState;
    private String message;
    private TransferPriceRequest request;
    private Date transitionDate;
    private String userid;
   
    public TransitionsLog(){}
   
    @Id
    @SequenceGenerator(name = "newLogSequence", sequenceName = "log_id_generator")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "newLogSequence")
    public Long getId(){
        return this.id;
    }
    public void setId(final Long id){
        this.id = id;
    }
    @Column(name="collection_id")
    public Long getCollectionId() {
        return collectionId;
    }

    public void setCollectionId(Long collectionId) {
        this.collectionId = collectionId;
    }
    @Column(name="from_cstate_id")
    public Long getFromState() {
        return fromState;
    }

    public void setFromState(Long fromState) {
        this.fromState = fromState;
    }
    @Column(name="to_cstate_id")
    public Long getToState() {
        return toState;
    }

    public void setToState(Long toState) {
        this.toState = toState;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
   
    @ManyToOne @JoinColumn(name="request_id")
    public TransferPriceRequest getRequest() {
        return request;
    }

    public void setRequest(final TransferPriceRequest request) {
        this.request = request;
    }
   
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="transition_date",updatable=false,insertable=false)
    @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT)
    public Date getTransitionDate() {
        return transitionDate;
    }
   
    public void setTransitionDate(final Date transitionDate){
        this.transitionDate = transitionDate;
    }
    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      //noinspection CastToConcreteClass
      final TransitionsLog that = (TransitionsLog) o;

      if (this.id != null ? !this.id.equals(that.id) : that.id != null) return false;
      //noinspection RedundantIfStatement

      return true;
   }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 79 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }
    @Column(name="user_id")
    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }
   
}


My BIG request object
Code:
public abstract class TransferPriceRequest implements Serializable{
   
    private Set<TransitionsLog> logs = new TreeSet<TransitionsLog>();
    private Long id;
    private Long version;
    private Division division;
    private Long divisionId;
    private String buyingLocation;
    private Double buyFxRate;
    private String buyFxCur;
    private Double discountUsd;
    private Double discountPct;
    private Double discountLc;
    private Double dutyPct;
    private Double dutyLc;
    private Double dutyUsd;
    private IncoTerms incoTerm;
    private Long incoTermId;
    private Double freightInsLc;
    private Double freightInsUsd;
    private Double freightInsPct;
    private String fxRatePeriod;
    private Double grossMarginLc;
    private Double grossMarginPctLc;
    private Double grossMarginPctUsd;
    private Double grossMarginUsd;
    private Double inMarketXfactPriceUsd;
    private Double inMarketXfactPriceLc;
    private Double invFxRate;
    private String invFxCur;
    private String invProdSrc;
    private ProductType invProdType;
    private Long invProductTypeId;
    private String invSapCode;
    private String invoicePoint;
    private Double invPointLgmPct;
    private Double landedCostLc;
    private Double landedCostUsd;
    private Double localCostLc;
    private Double localCostUsd;
    private Double localVaUsd;
    private Double localVaLc;
    private String localValAddText;
    private String markProdSrc;
    private String markSapCode;
    private Double netInMarketLc;
    private Double netInMarketUsd;
    private Double otherLc;
    private String otherText;
    private Double otherUsd;
    private ProductGroup prodGrp;
    private String prodGrpId;
    private String shipTo;
    private Double transConvMarketSrcLc;
    private Double transConvMarketSrcUsd;
    private Double transPriceUsd;
    private Double transPriceA;
    private Double utilFactorLc;
    private Double volumeOne;
    private Double volumeTwo;
    private Double volumeThree;
   // private String manufacturingPoint;
    private Date lastUpdate;
    private Date created;
    private DraftRequest draft;
    private Date effectiveDate;
     
    @Id
    @SequenceGenerator(name = "newRequestSequence", sequenceName = "request_id_generator")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "newRequestSequence")
    public Long getId() {
        return this.id;
    }
   
    public void setId(final Long id){
        this.id = id;
    }
    @Column(name="buying_location")
    public String getBuyingLocation() {
        return buyingLocation;
    }

    public void setBuyingLocation(final String buyingLocation) {
        this.buyingLocation = buyingLocation;
    }
    @Column(name="buying_fx_rate")
    public Double getBuyFxRate() {
        return buyFxRate;
    }

    public void setBuyFxRate(final Double buyFxRate) {
        this.buyFxRate = buyFxRate;
    }
    @Column(name="buying_lc")
    public String getBuyFxCur() {
        return buyFxCur;
    }

    public void setBuyFxCur(final String buyingLc) {
        this.buyFxCur = buyingLc;
    }
    @Column(name="discount_usd")
    public Double getDiscountUsd() {
        return discountUsd;

    }

    public void setDiscountUsd(final Double discUsd) {
        this.discountUsd = discUsd;
    }
    @Column(name="discount_pct")
    public Double getDiscountPct() {
        return discountPct;
    }

    public void setDiscountPct(final Double discounts) {
        this.discountPct = discounts;
    }
    @Column(name="duty_pct")
    public Double getDutyPct() {
        return dutyPct;
    }

    public void setDutyPct(final Double duty) {
        this.dutyPct = duty;
    }
    @Column(name="duty_lc")
    public Double getDutyLc() {
        return dutyLc;
    }

    public void setDutyLc(final Double dutyLc) {
        this.dutyLc = dutyLc;
    }
    @Column(name="duty_usd")
    public Double getDutyUsd() {
        return dutyUsd;
    }

    public void setDutyUsd(final Double dutyUs) {
        this.dutyUsd = dutyUs;
    }
    @Column(name="freight_insurance_lc")
    public Double getFreightInsLc() {
        return freightInsLc;
    }
   
    public void setFreightInsLc(final Double freInsLc) {
        this.freightInsLc = freInsLc;
    }
    @Column(name="freight_insurance_usd")
    public Double getFreightInsUsd() {
        return freightInsUsd;
    }

    public void setFreightInsUsd(final Double freInsUs) {
        this.freightInsUsd = freInsUs;
    }
    @Column(name="freight_insurance_pct")
    public Double getFreightInsPct() {
        return freightInsPct;
    }

    public void setFreightInsPct(final Double freightIns) {
        this.freightInsPct = freightIns;
    }
    @Column(name="fx_rate_period")
    public String getFxRatePeriod() {
        return fxRatePeriod;
    }

    public void setFxRatePeriod(final String fxRatePeriod) {
        this.fxRatePeriod = fxRatePeriod;
    }
    @Column(name="local_gross_margin_lc")
    public Double getGrossMarginLc() {
        return grossMarginLc;
    }

    public void setGrossMarginLc(final Double grossMarginLc) {
        this.grossMarginLc = grossMarginLc;
    }
    @Column(name="local_gross_margin_lc_pct")
    public Double getGrossMarginPctLc() {
        return grossMarginPctLc;
    }

    public void setGrossMarginPctLc(final Double grossMarginPercLc) {
        this.grossMarginPctLc = grossMarginPercLc;
    }
    @Column(name="local_gross_margin_usd_pct")
    public Double getGrossMarginPctUsd() {
        return grossMarginPctUsd;
    }

    public void setGrossMarginPctUsd(final Double grossMarginPercUs) {
        this.grossMarginPctUsd = grossMarginPercUs;
    }
    @Column(name="local_gross_margin_usd")
    public Double getGrossMarginUsd() {
        return grossMarginUsd;
    }

    public void setGrossMarginUsd(final Double grossMarginUs) {
        this.grossMarginUsd = grossMarginUs;
    }
    @Column(name="in_market_price_usd")
    public Double getInMarketXfactPriceUsd() {
        return inMarketXfactPriceUsd;
    }

    public void setInMarketXfactPriceUsd(final Double inMarketXPrice) {
        this.inMarketXfactPriceUsd = inMarketXPrice;
    }
    @Column(name="in_market_price_lc")
    public Double getInMarketXfactPriceLc() {
        return inMarketXfactPriceLc;
    }

    public void setInMarketXfactPriceLc(final Double inMarketXfactPrice) {
        this.inMarketXfactPriceLc = inMarketXfactPrice;
    }
    @Column(name="invoice_point_fx_rate")
    public Double getInvFxRate() {
        return invFxRate;
    }

    public void setInvFxRate(final Double invFxRate) {
        this.invFxRate = invFxRate;
    }
    @Column(name="invoiced_src")
    public String getInvProdSrc() {
        return invProdSrc;
    }

    public void setInvProdSrc(final String invProdSrc) {
        this.invProdSrc = invProdSrc;
    }
    @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name="transfer_type")
    public ProductType getInvProdType() {
        return invProdType;
    }

    public void setInvProdType(final ProductType invProdType) {
        this.invProdType = invProdType;
    }
   
    @Column(name="invoiced_sap_code")
    public String getInvSapCode() {
        return invSapCode;
    }

    public void setInvSapCode(final String invSapCode) {
        this.invSapCode = invSapCode;
    }
    @Column(name="invoice_point")
    public String getInvoicePoint() {
        return invoicePoint;
    }

    public void setInvoicePoint(final String invoicePoint) {
        this.invoicePoint = invoicePoint;
    }
    @Column(name="total_landed_cost_lc")
    public Double getLandedCostLc() {
        return landedCostLc;
    }

    public void setLandedCostLc(final Double landedCostLc) {
        this.landedCostLc = landedCostLc;
    }
    @Column(name="total_landed_cost_usd")
    public Double getLandedCostUsd() {
        return landedCostUsd;
    }

    public void setLandedCostUsd(final Double landedCostUs) {
        this.landedCostUsd = landedCostUs;
    }
    @Column(name="total_local_cost_lc")
    public Double getLocalCostLc() {
        return localCostLc;
    }

    public void setLocalCostLc(final Double localCostLc) {
        this.localCostLc = localCostLc;
    }
    @Column(name="total_local_cost_usd")
    public Double getLocalCostUsd() {
        return localCostUsd;
    }

    public void setLocalCostUsd(final Double localCostUs) {
        this.localCostUsd = localCostUs;
    }
    @Column(name="local_value_added_usd")
    public Double getLocalVaUsd() {
        return localVaUsd;
    }

    public void setLocalVaUsd(final Double localVaUs) {
        this.localVaUsd = localVaUs;
    }
    @Column(name="local_value_added_lc")
    public Double getLocalVaLc() {
        return localVaLc;
    }

    public void setLocalVaLc(final Double localVaLc) {
        this.localVaLc = localVaLc;
    }
    @Column(name="local_value_added_desc")
    public String getLocalValAddText() {
        return localValAddText;
    }

    public void setLocalValAddText(final String localValAddText) {
        this.localValAddText = localValAddText;
    }
    @Column(name="marketed_src")
    public String getMarkProdSrc() {
        return markProdSrc;
    }

    public void setMarkProdSrc(final String markProdSrc) {
        this.markProdSrc = markProdSrc;
    }
    @Column(name="marketed_sap_code")
    public String getMarkSapCode() {
        return markSapCode;
    }

    public void setMarkSapCode(final String markSapCode) {
        this.markSapCode = markSapCode;
    }
    @Column(name="net_in_market_price_lc")
    public Double getNetInMarketLc() {
        return netInMarketLc;
    }

    public void setNetInMarketLc(final Double netInMarkLc) {
        this.netInMarketLc = netInMarkLc;
    }
    @Column(name="net_in_market_price_usd")
    public Double getNetInMarkUsd() {
        return netInMarketUsd;
    }

    public void setNetInMarkUsd(final Double netInMarkUs) {
        this.netInMarketUsd = netInMarkUs;
    }
    @Column(name="other_lc")
    public Double getOtherLc() {
        return otherLc;
    }

    public void setOtherLc(final Double otherLc) {
        this.otherLc = otherLc;
    }
    @Column(name="other_desc")
    public String getOtherText() {
        return otherText;
    }

    public void setOtherText(final String otherText) {
        this.otherText = otherText;
    }
   
    @Column(name="other_usd")
    public Double getOtherUsd() {
        return otherUsd;
    }

    public void setOtherUsd(final Double otherUs) {
        this.otherUsd = otherUs;
    }

    @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name="product_group_id")
    public ProductGroup getProdGrp() {
        return prodGrp;
    }

    public void setProdGrp(final ProductGroup prodGrp) {
        this.prodGrp = prodGrp;
    }
   
    @Column(name="ship_to_destination")
    public String getShipTo() {
        return shipTo;
    }

    public void setShipTo(final String shipTo) {
        this.shipTo = shipTo;
    }
    @Column(name="xfer_price_2_market_src_lc")
    public Double getTransConvMarketSrcLc() {
        return transConvMarketSrcLc;
    }

    public void setTransConvMarketSrcLc(final Double transConvMarkSrcLc) {
        this.transConvMarketSrcLc = transConvMarkSrcLc;
    }
    @Column(name="xfer_price_2_market_src_usd")
    public Double getTransConvMarketSrcUsd() {
        return transConvMarketSrcUsd;
    }

    public void setTransConvMarketSrcUsd(final Double transConvMarkSrcUs) {
        this.transConvMarketSrcUsd = transConvMarkSrcUs;
    }

    @Column(name="transfer_price_usd")
    public Double getTransPriceUsd() {
        return transPriceUsd;
    }

    public void setTransPriceUsd(final Double transPriceUs) {
        this.transPriceUsd = transPriceUs;
    }
   
    @Column(name="transfer_price_lc")
    public Double getTransPriceA() {
        return transPriceA;
    }

    public void setTransPriceA(final Double transPriceLc) {
        this.transPriceA = transPriceLc;
    }
    @Column(name="utilization_factor_lc")
    public Double getUtilFactorLc() {
        return utilFactorLc;
    }

    public void setUtilFactorLc(final Double utilFactor) {
        this.utilFactorLc = utilFactor;
    }
    @Column(name="volume_curr_yr")
    public Double getVolumeOne() {
        return volumeOne;
    }

    public void setVolumeOne(final Double volumeOne) {
        this.volumeOne = volumeOne;
    }
    @Column(name="volume_curr_yr_plus_one")
    public Double getVolumeTwo() {
        return volumeTwo;
    }

    public void setVolumeTwo(final Double volumeTwo) {
        this.volumeTwo = volumeTwo;
    }
    @Column(name="volume_curr_yr_plus_two")
    public Double getVolumeThree() {
        return volumeThree;
    }
   
    public void setVolumeThree(final Double volumeThree) {
        this.volumeThree = volumeThree;
    }
/*
    public String getManufacturingPoint() {
        return manufacturingPoint;
    }

    public void setManufacturingPoint(final String manufacturingPoint) {
        this.manufacturingPoint = manufacturingPoint;
    }
*/
    @Temporal(TemporalType.DATE)
    @Column(name="last_update", updatable = false, insertable = false)
    @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.ALWAYS)
    public Date getLastUpdate() {
        return lastUpdate;
    }
   
    public void setLastUpdate(final Date lastUpdate){
        this.lastUpdate = lastUpdate;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="created", updatable = false, insertable = false)
    @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT)
    public Date getCreated() {
        return created;
    }
   
    public void setCreated(final Date created){
        this.created = created;
    }
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name="inco_terms_id")
    public IncoTerms getInco() {
        return incoTerm;
    }
   
    public void setInco(final IncoTerms inco) {
        this.incoTerm = inco;
    }
   
    @OneToMany(fetch = FetchType.EAGER,
            mappedBy="request",
            cascade={CascadeType.PERSIST})
            @OrderBy("transitionDate")
    public Set<TransitionsLog> getLogs(){
        return logs;
    }
   
    public void setLogs(final Set<TransitionsLog> logs){
        this.logs = logs;
    }
   
    public void addLog(TransitionsLog log){
        log.setRequest(this);
        logs.add(log);
    }
   
    @Version
    public Long getVersion() {
   return this.version;
   }
    public void setVersion(final Long version){
        this.version = version;
    }
    @OneToOne @PrimaryKeyJoinColumn
    public DraftRequest getDraft() {
        return draft;
    }

    public void setDraft(DraftRequest draft) {
        this.draft = draft;
    }
    @Column(name="inv_local_gross_margin_pct")
    public Double getInvPointLgmPct() {
        return invPointLgmPct;
    }

    public void setInvPointLGMPct(Double invLocalGrossMarginPct) {
        this.invPointLgmPct = invLocalGrossMarginPct;
    }
   
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        //noinspection CastToConcreteClass
        final TransferPriceRequest that = (TransferPriceRequest) o;

        if (this.id != null ? !this.id.equals(that.id) : that.id != null) return false;
        //noinspection RedundantIfStatement
        if (this.version != null ? !this.version.equals(that.version) : that.version != null) return false;

        return true;
   }

    @Override
     public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (this.version != null ? this.version.hashCode() : 0);
        result = 31 * result + (this.id != null ? this.id.hashCode() : 0);
        return result;
   }
   
    @Column(name="discount_lcd")
    public Double getDiscountLc() {
        return discountLc;
    }

    public void setDiscountLc(Double discountLc) {
        this.discountLc = discountLc;
    }
    @Transient
    public Long getIncoTermId() {
        return incoTermId;
    }

    public void setIncoTermId(Long incoTermId) {
        this.incoTermId = incoTermId;
    }
    @Transient
    public Long getInvProductTypeId() {
        return invProductTypeId;
    }

    public void setInvProductTypeId(Long invProdTypeId) {
        this.invProductTypeId = invProdTypeId;
    }
    @Transient
    public String getProdGrpId() {
        return prodGrpId;
    }

    public void setProdGrpId(String prodGrpId) {
        this.prodGrpId = prodGrpId;
    }
    @Column(name="invoice_point_currency")
    public String getInvFxCur() {
        return invFxCur;
    }

    public void setInvFxCur(String invFxCur) {
        this.invFxCur = invFxCur;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="effective_date")
    public Date getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }
   
    public Division getDivision() {
        return division;
    }

    public void setDivision(Division division) {
        this.division = division;
    }

    public Long getDivisionId() {
        return divisionId;
    }

    public void setDivisionId(Long divisionId) {
        this.divisionId = divisionId;
    }

}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.