Hi,
I am quite new to hibernate so this might be an newbe-problem:
I am trying to persist a collection (HashMap<String, byte[]>) with Hibernate. I am getting an
org.hibernate.MappingException: map index element must specify a type: eu.basi.fax.core.FaxCampaignImpl.jobs
Can anybody tell what this message means an how it can be recovered?
This is the mapping
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="eu.basi.fax.core">
<class name="FaxCampaignImpl">
<id name="id">
<generator class="native" />
</id>
<property name="deleted" />
<property name="name" />
<property name="recipientGroup" />
<property name="prio" />
<map name="jobs" lazy="true">
<key column="id" />
<index column="basi_client_id" />
<one-to-many class="gnu.hylafax.job.Job" />
</map>
<property name="start" />
<property name="end" />
<map name="documents" lazy="true">
<key column="id" />
<index column="fileName" />
<element column="file" type="binary" />
</map>
<property name="status" />
</class>
<class name="gnu.hylafax.job.Job">
<id name="id" column="jobId" />
<property name="chopThreshold" />
<property name="dialstring" />
<property name="documentName" />
<property name="fromUser" />
<property name="jobInfo" />
<property name="killtime" />
<property name="maximumDials" />
<property name="maximumTries" />
<property name="notifyAddress" />
<property name="notifyType" />
<property name="pageChop" />
<property name="pageDimension" />
<property name="pageLength" />
<property name="pageWidth" />
<property name="priority" />
<property name="retrytime" />
<property name="tagline" />
<property name="useTagline" />
<property name="verticalResolution" />
</class>
</hibernate-mapping>
The persistent class is:
Code:
public class FaxCampaignImpl implements FaxCampaign {
private Integer id;
private Boolean deleted;
private String name;
private String recipientGroup;
private Integer prio;
private Map<String, gnu.hylafax.Job> jobs;
private Calendar start;
private Calendar end;
private HashMap<String, byte[]> documents;
private Status status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map<String, gnu.hylafax.Job> getJobs() {
return jobs;
}
public void setJobs(Map<String, gnu.hylafax.Job> jobs) {
this.jobs = jobs;
}
public Calendar getStart() {
return start;
}
public void setStart(Calendar start) {
this.start = start;
}
public Calendar getEnd() {
return end;
}
public void setEnd(Calendar end) {
this.end = end;
}
public void setPrio(Integer prio) {
this.prio = prio;
}
public Integer getPrio() {
return prio;
}
public void setRecipientGroup(String recipientGroup) {
this.recipientGroup = recipientGroup;
}
public String getRecipientGroup() {
return recipientGroup;
}
public HashMap<String, byte[]> getDocuments() {
return documents;
}
public void setDocuments(HashMap<String, byte[]> documents) {
this.documents = documents;
}
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
public Boolean isDeleted() {
return deleted;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
}
I would be very grateful if somebody could help!
regards
neurox