<property
name = "homePhone"
column = "HOME_PHONE"/>
<property
name = "mobilePhone"
column = "MOBILE_PHONE"/>
<property
name = "dateRegistered"
column = "DATE_REGISTERED"
type = "date"/>
<property
name = "dateModified"
column = "DATE_MODIFIED"
type ="date"/>
</class>
</hibernate-mapping>
Consumer.java
package Hibernate;
import java.util.Date;
public class Consumer {
private String id;
private String name;
private String address;
private String homePhone;
private String mobilePhone;
private Date dateRegistered;
private Date dateModified;
public Consumer() {}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getHomePhone() {
return homePhone;
}
public void setHomePhone(String homePhone) {
this.homePhone = homePhone;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public Date getDateRegistered() {
return dateRegistered;
}
public void setDateRegistered(Date dateRegistered) {
this.dateRegistered = dateRegistered;
}
public Date getDateModified() {
return dateModified;
}
public void setDateModified(Date dateModified) {
this.dateModified = dateModified;
}
private void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
}
Please let me know what could be the problem. If my application is not able to connect to the database will it be able to parse the configuration and mapping files? I am trying to figure out if the problem is in the code/syntax or is it because its not able to connect to the database.
do you have the hibernate package? and a path like this?
<mapping resource="Hibernate/Consumer.hbm.xml"/>
As Cameron said it looks like the resource is not available at run time. Did you try to debug and what is the error you get? If possible post the stack trace.