-->
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: Can I map a table without primary key ?
PostPosted: Sat Aug 21, 2004 11:29 am 
Newbie

Joined: Fri Aug 20, 2004 9:07 pm
Posts: 5
Location: antofagasta-chile
Hibernate version:2.1

i have a table without primary key( is a historical table ), and
that is the map created by ReverseGenerator.bat
Mapping documents:
<hibernate-mapping>
<class name="cl.di.sone.servicio.AuditOnlineServicio" schema="online2" table="AUDIT_SERVICIO">
<property column="RUT" length="12" name="rut" type="java.lang.Long"/>
<property column="FECHA_CONEXION" length="7" name="fechaConexion" type="java.util.Date"/>
<property column="IP_MAQUINA" length="20" name="ipMaquina" type="java.lang.String"/>
<property column="ID_SERVICIO" length="10" name="idServicio" type="java.lang.Long"/>
</class>
</hibernate-mapping>


Name and version of the database you are using: oracle 8i

that leave me clear, i can't have a mapping without *id*

Debug level Hibernate log excerpt:
INFO Configuration:350 - Mapping resource: cl/ucn/di/Sone/autentificar/AuditActivaOnline.hbm.xml
ERROR XMLHelper:48 - Error parsing XML: XML InputStream(5) The content of element type "id" is incomplete, it must match "(column?,generator)".




but my doubt is, i can map a table whitout primary key? and how?


please so sorry my language...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 21, 2004 11:32 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
you must find a way to define a business identity for your object (it is not the same that the database id or primary key).
If you can't define the object unicity, then you won't be able to map it.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Last edited by anthony on Sat Aug 21, 2004 11:40 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 21, 2004 11:37 am 
Newbie

Joined: Fri Aug 20, 2004 9:07 pm
Posts: 5
Location: antofagasta-chile
thanks


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.