-->
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: Tomcat JDBCRealm mapping
PostPosted: Tue Aug 31, 2004 10:25 am 
Newbie

Joined: Wed Jul 21, 2004 3:58 am
Posts: 17
Hi guys !

I'd like to manage the users of my tomcat JDBCRealm with hibernate. But i don't know if my mapping is true. Someone can help me ?


My mapping files :

<hibernate-mapping>
<class name="capgemini.gestionav.modele.valueobject.UtilisateurDTO" table="User">
<id name="nom">
<column name="User_Nom" length="32" not-null="true"/>
<generator class="assigned"/>
</id>
<property name="password">
<column name="User_Pass" length="32" not-null="true"/>
</property>
<set name="userroles" table="user_role" inverse="true" lazy="true">
<key column="User_Nom"/>
<many-to-many class="capgemini.gestionav.modele.valueobject.RoleDTO" column="Role_id"/>
</set>
</class>

<class name="capgemini.gestionav.modele.valueobject.RoleDTO" table="Role">
<id name="nom">
<column name="Role_Nom" length="32" not-null="true"/>
<generator class="assigned"/>
</id>
</class>



Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 31, 2004 10:30 am 
Newbie

Joined: Wed Jul 21, 2004 3:58 am
Posts: 17
For those who don't know how work exactly the tomcat jdbc realm, you must have two tables like that :


create table users (
user_name varchar(15) not null primary key,
user_pass varchar(15) not null
);

create table user_roles (
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key (user_name, role_name)
);



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.