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: Organizing Mapping files into packages
PostPosted: Fri Aug 26, 2005 4:24 pm 
Newbie

Joined: Fri Aug 26, 2005 4:13 pm
Posts: 2
I have quite a few tables to be mapped and I don't want all the mapping files into one directory. So if I organize the mapping into different packages how to import the pacakge names into the mapping files?.

For example here is a mapping file

<hibernate-mapping package="com.skila.iworksite.notify.model">

<class name="SkilaNotification" table="SKILA_NOTIFICATION">
<id name="notificationId" column="NOTIFICATION_ID" type="long">
<generator class="sequence"/>
</id>

<property name="notificationType" column="NOTIFICATION_TYPE" type="string" not-null="true" />
<property name="notificationDate" column="NOTIFICATION_DATE" type="date" not-null="true" />

<many-to-one name="skilaUser" column="OWNER_USER_ID" class="com.skila.iworksite.masterdata.model.SkilaUser" not-null="true" />

<many-to-one name="skilaUser1" column="ASSIGNED_USER_ID" class="com.skila.iworksite.masterdata.model.SkilaUser" />
</class>

</hibernate-mapping>

This mapping has a dependency on the class "com.skila.iworksite.masterdata.model.SkilaUser".

The question is can I import the package name and avoid typing the package everytime.? If yes How to do it ?.

Thanks


Top
 Profile  
 
 Post subject: annotations
PostPosted: Fri Aug 26, 2005 5:19 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Well, if you are to lazy to type :) then you may appreciate copuple of annotation based approaches:
Hibernate annotations
http://www.hibernate.org/hib_docs/annot ... e/en/html/
or Xdoclet
http://xdoclet.sourceforge.net/xdoclet/ ... tTask.html

In both cases you will not have to type mapping dociments at all :)

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 2:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
or use the plugins at tools.hibernate.org and get code completion ;)

_________________
Max
Don't forget to rate


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.