Hi,
I'm trying to map a Oracle 10 View with Hibernate 3.2.6.
I've created an Entity class with the same name as the View in Oracle - but while starting the JBoss App Server Hibernate still trys to create a table.
Probably i'm using the wrong datatypes in my Entity class - can you please check the Oracle View and my Entity class?
Thanks a lot!
altes-kind
Code:
19:01:36,922 INFO [DatabaseMetadata] table not found: VTERMINGELDER2
.
.
.
19:01:37,625 ERROR [SchemaUpdate] Unsuccessful: create table VTERMINGELDER2 (KONTONUMMER number(10,0) not null, KUNDENNUMMER number(10,0), SOLLZINS char(1 char), INTERESTRATE float, ANLAGEFRIST number(5,0), ANLAGEVOLUMEN double precision, KZ number(1,0), FAELLIG timestamp, LAUFZEITBEGINN timestamp, ART number(1,0), ZKBPASSIV char(1 char), primary key (KONTONUMMER))
19:01:37,625 ERROR [SchemaUpdate] ORA-00955: name is already used by an existing object
Columns of the Oracle ViewCode:
View VTERMINGELDER2
==========================
KONTONUMMER - NUMBER (10)
KUNDENNUMMER - NUMBER (10)
ART - NUMBER (1)
LAUFZEITBEGINN - DATE
ANLAGEVOLUMEN - NUMBER (24,2)
SOLLZINS - NUMBER (5,3)
ZINSSATZ - NUMBER (5,3)
FAELLIG - DATE
KZ - NUMBER (1)
ANLAGEFRIST - NUMBER (3)
ZKBPASSIV - NUMBER (24,2)
Java Entity ClassCode:
package de.lbb.forcev2.pricing.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity(name = "VTERMINGELDER2")
public class TimeDeposit {
private Integer accountNumber;
private Integer customerNumber;
private Boolean type;
private Date startDate;
private BigDecimal investmentVolumne;
private BigDecimal interest;
private BigDecimal interestRate;
private Date maturityDate;
private Boolean kz;
private BigInteger investmentPeriod;
private BigDecimal zkbPassive;
/** @return the accountNumber */
@Column(name = "KONTONUMMER")
@Id
public Integer getAccountNumber() {
return accountNumber;
}
/** @param accountNumber the accountNumber to set */
public void setAccountNumber(Integer accountNumber) {
this.accountNumber = accountNumber;
}
/** @return the customerNumber */
@Column(name = "KUNDENNUMMER")
public Integer getCustomerNumber() {
return customerNumber;
}
/** @param customerNumber the customerNumber to set */
public void setCustomerNumber(Integer customerNumber) {
this.customerNumber = customerNumber;
}
/** @return the type */
@Column(name = "ART")
public Boolean getType() {
return type;
}
/** @param type the type to set */
public void setType(Boolean type) {
this.type = type;
}
/** @return the startDate */
@Temporal(TemporalType.DATE)
@Column(name = "LAUFZEITBEGINN")
public Date getStartDate() {
return startDate;
}
/** @param startDate the startDate to set */
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
/** @return the investmentVolumne */
@Column(name = "ANLAGEVOLUMEN", precision = 24, scale = 2)
public BigDecimal getInvestmentVolumne() {
return investmentVolumne;
}
/** @param investmentVolumne the investmentVolumne to set */
public void setInvestmentVolumne(BigDecimal investmentVolumne) {
this.investmentVolumne = investmentVolumne;
}
/** @return the interest */
@Column(name = "SOLLZINS", precision = 5, scale = 3)
public BigDecimal getInterest() {
return interest;
}
/** @param interest the interest to set */
public void setInterest(BigDecimal interest) {
this.interest = interest;
}
/** @return the interestRate */
@Column(name = "ZINSSATZ", precision = 5, scale = 3)
public BigDecimal getInterestRate() {
return interestRate;
}
/** @param interestRate the interestRate to set */
public void setInterestRate(BigDecimal interestRate) {
this.interestRate = interestRate;
}
/** @return the maturityDate */
@Temporal(TemporalType.DATE)
@Column(name = "FAELLIG")
public Date getMaturityDate() {
return maturityDate;
}
/** @param maturityDate the maturityDate to set */
public void setMaturityDate(Date maturityDate) {
this.maturityDate = maturityDate;
}
/** @return the kz */
@Column(name = "KZ")
public Boolean getKz() {
return kz;
}
/** @param kz the kz to set */
public void setKz(Boolean kz) {
this.kz = kz;
}
/** @return the investmentPeriod */
@Column(name = "ANLAGEFRIST", precision = 3)
public BigInteger getInvestmentPeriod() {
return investmentPeriod;
}
/** @param investmentPeriod the investmentPeriod to set */
public void setInvestmentPeriod(BigInteger investmentPeriod) {
this.investmentPeriod = investmentPeriod;
}
/** @return the zkbPassive */
@Column(name = "ZKBPASSIV", precision = 24, scale = 2)
public BigDecimal getZkbPassive() {
return zkbPassive;
}
/** @param zkbPassive the zkbPassive to set */
public void setZkbPassive(BigDecimal zkbPassive) {
this.zkbPassive = zkbPassive;
}
}