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.  [ 2 posts ] 
Author Message
 Post subject: Problems mapping List with Hibernate xdoclet tag
PostPosted: Mon Sep 13, 2004 2:41 pm 
Newbie

Joined: Mon Sep 13, 2004 2:23 pm
Posts: 6
Location: Los Angeles
Hibernate version: 2.1.6

This is what I'm doing:

/** Returns the keyword list associated with the referenced physical asset.
* @hibernate.list table="ImageMasterKeywords" lazy="false" cascade="save-update"
*
* @return List the keyworld list field.
*/

public List getKeywords() {
return keywords;
}

And the error I get is this:

[hibernatedoclet] org.xml.sax.SAXParseException: The content of element type "list" is incomplete, it must ma
ch "(meta*,(cache|jcs-cache)?,key,index,(element|one-to-many|many-to-many|composite-element|many-to-any))".
[hibernatedoclet] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
[hibernatedoclet] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)


I tried to all types of variations, but nothing works. What is the correct way to store a simple List with Strings in a separate table?

Thanks!

Michael

_________________
The problems that exist in the world today cannot be solved by the level of thinking that created them -- Albert Einstein (some smart dude)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 13, 2004 2:59 pm 
Newbie

Joined: Mon Sep 13, 2004 2:23 pm
Posts: 6
Location: Los Angeles
In the meantime I have also tried this:

/**
* Returns the keyword list associated with the referenced physical asset.
*
* @hibernate.bag name="keywords" lazy="true" inverse="true" cascade="delete"
* @hibernate.collection-key column="keywords_id"
* @hibernate.collection-one-to-many class="java.lang.String"
* @return List of keywords
*/

public List getKeywords() {
return keywords;
}

Which results in Hibernate not understanding 'java.lang.String' - do I really have to map this manually? And if yes, how? Anyway, here's my stack trace:

[junit] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'sessionFactory' defined in class path resource [applicationContext-hibernate.xml]: Initialization of bean fai
led; nested exception is net.sf.hibernate.MappingException: Association references unmapped class: java.lang.String
[junit] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Abs
tractAutowireCapableBeanFactory.java:301)
[junit] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Abs
tractAutowireCapableBeanFactory.java:208)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.j
ava:204)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.j
ava:136)
[junit] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleto
ns(DefaultListableBeanFactory.java:224)
[junit] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationC
ontext.java:284)
[junit] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlAppli
cationContext.java:80)
[junit] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlAppli
cationContext.java:65)
[junit] at com.enetworks.style2.ssms.common.dao.BaseDAOTestCase.<clinit>(BaseDAOTestCase.java:38)
[junit] ... 6 more

_________________
The problems that exist in the world today cannot be solved by the level of thinking that created them -- Albert Einstein (some smart dude)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.