Hi!
I'm using Hibernate synchronizer plugin on Eclipse IDE plataform. I'm getting a list of Ccliente objects without a problem, but when I add the many-to-one mapping to the Cempleado object I get the following Exception: net.sf.hibernate.MappingException: No persister for: java.lang.Integer.
Can any body helpme to find the problem?
Thank's in advance!
Rodolfo.
Hibernate version:
version 2.1.6, 9.8.2004
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="com.ia.bd">
<class name="Ccliente" table="ccliente">
<id
column="idcliente"
name="idcliente"
type="integer"
>
<generator class="native" />
</id>
<property
column="numerocliente"
length="10"
name="numerocliente"
not-null="true"
type="integer"
/>
<many-to-one
class="Cempleado"
name="idempleado"
not-null="true"
outer-join="auto"
>
<column name="idempleado"/>
</many-to-one>
</class>
</hibernate-mapping>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="com.ia.bd">
<class
name="Cempleado"
table="cempleado"
>
<id
name="idempleado"
type="integer"
column="idempleado"
>
<generator class="native"/>
</id>
<property
name="nombre"
column="nombre"
type="string"
not-null="true"
length="30"
/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Criteria c=session.createCriteria();
c.list();
Full stack trace of any exception that occurs:
net.sf.hibernate.MappingException: No persister for: java.lang.Integer
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2697)
at net.sf.hibernate.impl.SessionImpl.getEntityIdentifierIfNotUnsaved(SessionImpl.java:2759)
at net.sf.hibernate.type.EntityType.getIdentifier(EntityType.java:66)
at net.sf.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:47)
at net.sf.hibernate.loader.Loader.bindPositionalParameters(Loader.java:749)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:788)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:118)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3613)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
at com.ia.bd.dao._RootDAO.findFiltered(_RootDAO.java:59)
at com.ia.bd.dao._RootDAO.findFiltered(_RootDAO.java:31)
at com.ia.models.ClientesModel.getElements(ClientesModel.java:33)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:532)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:477)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:585)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:465)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:449)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:924)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:862)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:922)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:881)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:416)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:238)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1059)
at com.ia.creditoycobranza.ui.UIClientesConsulta.createDialogArea(UIClientesConsulta.java:214)
at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:632)
at org.eclipse.jface.window.Window.create(Window.java:348)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:925)
at org.eclipse.jface.window.Window.open(Window.java:637)
at com.ia.ventas.ui.UIPedido.muestraClientesConsulta(UIPedido.java:567)
at com.ia.ventas.ui.UIPedido.access$1(UIPedido.java:559)
at com.ia.ventas.ui.UIPedido$5.widgetSelected(UIPedido.java:164)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
at com.ia.Menu.main(Menu.java:112)
Name and version of the database you are using:
mysql 4.1.7
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: