-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Mapping files generation Error
PostPosted: Mon Feb 13, 2006 3:40 am 
Newbie

Joined: Wed Jul 21, 2004 7:44 am
Posts: 7
Hibernate version: 3.0

Mapping documents:

package com.sample;

import java.util.Date;

/**
* @hibernate.class table="Baseline"
* @author sandeshd
*
*/
public class Baseline {

//
// Bean properties
//

/**
* @hibernate.id generator-class="assigned"
*/
public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

/**
* @hibernate.property
* @return
*/
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

/**
* @hibernate.property
* @return
*/
public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

/**
* @hibernate.property
* @return
*/
public int getType() {
return type;
}

public void setType(int type) {
this.type = type;
}

/**
* @hibernate.property
* @return
*/
public Date getInitializationDate() {
return initializationDate;
}

public void setInitializationDate(Date initializationDate) {
this.initializationDate = initializationDate;
}

/**
* @hibernate.property
* @return
*/
public Date getLastUpdatedDate() {
return lastUpdatedDate;
}

public void setLastUpdatedDate(Date lastUpdatedDate) {
this.lastUpdatedDate = lastUpdatedDate;
}

/**
* @hibernate.property
* @return
*/
public Date getPermanentLockDate() {
return permanentLockDate;
}

public void setPermanentLockDate(Date permanentLockDate) {
this.permanentLockDate = permanentLockDate;
}

/**
* @hibernate.array table="baseline_signatories" cascade="save-update"
* @hibernate.collection-key column="baselineId"
* @hibernate.collection-index column="idx"
* @hibernate.collection-many-to-many column="User" class="com.sample.User"
*/
public User[] getPotentialSignatories() {
return potentialSignatories;
}


public void setPotentialSignatories(User[] potentialSignatories) {
this.potentialSignatories = potentialSignatories;
}

/**
* @hibernate.property
* @return
*/
public boolean isPermanentlyLocked() {
return isPermanentlyLocked;
}

public void setPermanentlyLocked(boolean isPermanentlyLocked) {
this.isPermanentlyLocked = isPermanentlyLocked;
}

//
// Private members
//
private int id;

private String name;

private String description;

private int type;

private Date initializationDate;

private Date lastUpdatedDate;

private Date permanentLockDate;

private User[] potentialSignatories;

private boolean isPermanentlyLocked;
}

Full stack trace of any exception that occurs:

hibernate:
[xdoclet2] Running org.xdoclet.plugin.hibernate.HibernateConfigPlugin
[xdoclet2] Running org.xdoclet.plugin.hibernate.HibernateMappingPlugin
[xdoclet2] * Generate mapping for 'Baseline' entity
[xdoclet2] File /E:/Home/test/classes/com/canarys/cf/extract/extractor/caliberrm/beans/Baseline.hbm.xml did not pass validation:
[xdoclet2] Line: 17 Column: 13
[xdoclet2] Message: The content of element type "array" is incomplete, it must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)".

BUILD FAILED
E:\Home\test\build.xml:53: org.generama.OutputValidationError:
Line: 17 Column: 13
Message: The content of element type "array" is incomplete, it must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)".

Name and version of the database you are using:
MySQL 4.1

I'm very much sure that I'm missing some mandatory field. Please let me know what I have to correct.


Top
 Profile  
 
 Post subject: Hibernate Mapping files generation Error
PostPosted: Mon Feb 13, 2006 9:09 am 
Newbie

Joined: Wed Jul 21, 2004 7:44 am
Posts: 7
I could able to resolve this. This was basically problem with xdoclet versioning. Since I was using xdoclet 2.0 I had to change the tag to @hibernate.collection-key to @hibernate.key and same with rest of the collection tags.

I was wondering how to map array of String objects. someting like

String[] getNames(){
return names;
}

void setNames(String[] names){
this.names = names;
}

In that case, how to use collection.


Top
 Profile  
 
 Post subject: Hibernate Mapping files generation Error
PostPosted: Mon Feb 13, 2006 9:11 am 
Newbie

Joined: Wed Jul 21, 2004 7:44 am
Posts: 7
I was able to resolve this. This was basically a problem with xdoclet version. Since I was using xdoclet 2.0 I had to change the tag to @hibernate.collection-key to @hibernate.key and same with rest of the collection tags.

But however, I was wondering how to map array of String objects. someting like;

String[] getNames(){
return names;
}

void setNames(String[] names){
this.names = names;
}

In that case, how to use collection.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.