[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3533) Duplicated columns in gen. sql(superfluous data transfer)

Igors Sakels (JIRA) noreply at atlassian.com
Thu Oct 16 03:57:05 EDT 2008


Duplicated columns in gen. sql(superfluous data transfer)
---------------------------------------------------------

                 Key: HHH-3533
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3533
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.3.1
         Environment: Hibernate version:
3.3.1 
Name and version of the database you are using:
Oracle 9i 
            Reporter: Igors Sakels
            Priority: Minor


Mapping documents:
@Entity
@org.hibernate.annotations.Entity(mutable = false)
@Table(name = "demo_tmp_fin_header")
public class TmpFinHeader {
@Id
@Column(name = "edw_doc_id")
private String edwDocId;

@Column(name = "period")
private Date period;

@OneToMany
@JoinColumn(name = "edw_doc_id")
@org.hibernate.annotations.BatchSize(size = 100)
private Set<TmpFinData> tmpFinDataSet = new HashSet<TmpFinData>();

// getters, setters
}

@Entity
@org.hibernate.annotations.Entity(mutable = false)
@Table(name = "demo_tmp_fin_data")
public class TmpFinData {
@EmbeddedId
private TmpFinDataId tmpFinDataId;

@Column(name = "amount")
private BigDecimal amount;

// getters, setters
}

@Embeddable
public class TmpFinDataId implements Serializable {
@Column(name = "edw_doc_id")
private String edwDocId;

@Column(name = "amount_id")
private String amountId;

// getters, setters, equals, hashCode
}

Code between sessionFactory.openSession() and session.close():
TmpFinHeader header = hibernateTemplate.get(TmpFinHeader.class, 1);
header.getTmpFinDataSet().size();

The generated SQL (show_sql=true):
select
tmpfindata0_.edw_doc_id as edw2_1_,
tmpfindata0_.amount_id as amount1_1_,
tmpfindata0_.amount_id as amount1_1_0_,
tmpfindata0_.edw_doc_id as edw2_1_0_,
tmpfindata0_.amount as amount1_0_
from
gl_loan.demo_tmp_fin_data tmpfindata0_
where
tmpfindata0_.edw_doc_id=?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list