Hello to everyone,
I made an Image.hbm.xml and save it to src/dao/*/model. The contents of
the file is like this:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.voxsant.thinkscan.model.Image" table="image">
<id name="id">
<generator class="native"/>
</id>
<property name="filename"/>
<property name="displayOrder" column="display_order"/>
<property name="canonicalPath" column="canonical_path"/>
<property name="imageCreated" column="image_created"/>
<property name="imageModified" column="image_modified"/>
</class>
</hibernate-mapping>
============and my src/dao/*/model/Image.java has a contents like this:
package com.voxsant.thinkscan.model;
import org.acegisecurity.GrantedAuthority;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.util.Date;
public class Image extends BaseModel {
private String fileName;
private int displayOrder;
private Page parentPage;
private String canonicalPath;
private Date imageCreated;
private Date imageModified;
public Image(String fileName, String canonicalPath ) throws
IllegalArgumentException{
}
public Image(){
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public int getDisplayOrder() {
return displayOrder;
}
public void setDisplayOrder(int displayOrder) {
this.displayOrder = displayOrder;
}
public Page getParentPage() {
return parentPage;
}
public void setParentPage(Page parentPage) {
this.parentPage = parentPage;
}
public String getCanonicalPath() {
return canonicalPath;
}
public void setCanonicalPath(String canonicalPath) {
this.canonicalPath = canonicalPath;
}
public Date getImageCreated() {
return imageCreated;
}
public void setImageCreated(Date imageCreated) {
this.imageCreated = imageCreated;
}
public Date getImageModified() {
return imageModified;
}
public void setImageModified(Date imageModified) {
this.imageModified = imageModified;
}
}
========The problem is there's an error message when I run ant setup-db:
db-prepare:
[echo] generating database.properties from build.properties
[propertyfile] Creating new property
file: /home/adriel/PROJECT/Thinkscan/database.properties
[schemaexport] (cfg.Environment 500 ) Hibernate
3.2.0
[schemaexport] (cfg.Environment 533 )
hibernate.properties not found
[schemaexport] (cfg.Environment 667 ) Bytecode
provider name : cglib
[schemaexport] (cfg.Environment 584 ) using JDK 1.4
java.sql.Timestamp handling
[schemaexport] (cfg.Configuration 274 ) Reading
mappings from
file:
/home/adriel/PROJECT/Thinkscan/build/dao/gen/com/voxsant/thinkscan/model/Demog.hbm.xml
[schemaexport] (cfg.HbmBinder 300 ) Mapping class:
com.voxsant.thinkscan.model.Demog -> demog
[schemaexport] (cfg.Configuration 274 ) Reading
mappings from
file:
/home/adriel/PROJECT/Thinkscan/build/dao/gen/com/voxsant/thinkscan/model/Image.hbm.xml
[schemaexport] (cfg.HbmBinder 300 ) Mapping class:
com.voxsant.thinkscan.model.Image -> image
BUILD FAILED
/home/adriel/PROJECT/Thinkscan/build.xml:754: Schema text failed: Could
not parse mapping document from
file
/home/adriel/PROJECT/Thinkscan/build/dao/gen/com/voxsant/thinkscan/model/Image.hbm.xml
How can I solve these errors? Thank you for your immediate reply. God
bless you.
adriel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]