Dear community members,
I am trying to run example(link bellow) using NetBeans 5.5,Hibernate-3.2.0,cr4 Hibernate-entitymanager-3.2.0.cr2
PostgreSQL 8.1, and Sun application server 9
http://www.netbeans.org/kb/articles/hibernate-javaee.html
Wizard has generated some JSF using entities which are generated with hibernate netbeans tools.
I can ping my database and I can connect to my database through runtime
window - in addition, entities are successfully generated, build and
deployment cycle is successful.My database schema is public.
All parts run ok, but when I fill generated JSF-s with some data.
In my browser I receive messages that my values
Quote:
ARE successfully added
even if records in my database are not added!When I try to delete a record existing in my database I receive
message that
Quote:
values are successfully deleted
but my database still
remains unchanged.
all my columns in entites are insertable=true, updatable=true
I use only one table in my database calendar
here is generated entity
Code:
@Entity
@Table(name = "dugovi")
@NamedQueries( {@NamedQuery(name = "Dugovi.findById", query = "SELECT d FROM Dugovi d WHERE d.id = :id"), @NamedQuery(name = "Dugovi.findByAmount", query = "SELECT d FROM Dugovi d WHERE d.amount = :amount"), @NamedQuery(name = "Dugovi.findByName", query = "SELECT d FROM Dugovi d WHERE d.name = :name"), @NamedQuery(name = "Dugovi.findBySurname", query = "SELECT d FROM Dugovi d WHERE d.surname = :surname"), @NamedQuery(name = "Dugovi.findByTerm", query = "SELECT d FROM Dugovi d WHERE d.term = :term")})
public class Dugovi implements Serializable {
@Id
@Column(name = "id", nullable = false, insertable=true, updatable=true)
private Integer id;
@Column(name = "amount", insertable=true, updatable=true)
private Double amount;
@Column(name = "name", insertable=true, updatable=true)
private String name;
@Column(name = "surname", insertable=true, updatable=true)
private String surname;
@Column(name = "term", nullable=true, insertable=true, updatable=true)
@Temporal(TemporalType.TIMESTAMP)
private Date term;
/** Creates a new instance of Dugovi */
public Dugovi() {
}
public Dugovi(Integer id) {
this.id = id;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getAmount() {
return this.amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return this.surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public Date getTerm() {
return this.term;
}
public void setTerm(Date term) {
this.term = term;
}
public int hashCode() {
int hash = 0;
hash += (this.id != null ? this.id.hashCode() : 0);
return hash;
}
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Dugovi)) {
return false;
}
Dugovi other = (Dugovi)object;
if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
return true;
}
public String toString() {
return "src.Dugovi[id=" + id + "]";
}
}
here is my persistence.xmlCode:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="CurryPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>debiti</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.dialect"value="org.hibernate.dialect.PostgreSQLDialect"/>
</properties>
</persistence-unit>
</persistence>
I would appreciate if someone could help me and tell me
the cause of my problem.
best regards,
Nikola