-->
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.  [ 1 post ] 
Author Message
 Post subject: Issue on persistence mapping.ideas needed!!
PostPosted: Mon Nov 14, 2011 11:03 am 
Newbie

Joined: Mon Nov 14, 2011 10:27 am
Posts: 1
Hi guys, Im having some troubles trying to configure a many to many relationship between a class i have just created (Installsupport) and another one called userInfo which as implementation of springframework.security.core.userdetails..

the idea is creating and inbetween table named /Users_InstallSupport) where Installsupport and UserInfo where a given object installSupport is able to get all the Usernames of the users related to it (IinstallSupport will be the owner of the table)

this is InstallSUpport.hbm.xml set property:

<set name="users"
table="User_InstallSupport"
lazy="false"
cascade="all-delete-orphan"
inverse="true">

<key column="installSupport_id" not-null="true"/>
<many-to-many class="com.albentia.products.security.data.UserInfo">
<column name="username" not-null="true" />
</many-to-many>

</set>


and here i have sql code for the created tables:
************************ Installsupport class TABLE ************************************

CREATE TABLE `InstallSupport` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`problemDescription` text,
`setupDate` datetime NOT NULL,
`solDescription` text,
`customSetup_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT=' represents a home setup intervenction';




******** users table*************

CREATE TABLE `users` (
`username` varchar(50) CHARACTER SET latin1 NOT NULL,
`password` varchar(50) CHARACTER SET latin1 NOT NULL,
`enabled` tinyint(1) NOT NULL,
`name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin2 COMMENT='Spring security DB schema';
/*!40101 SET character_set_client = @saved_cs_client */;

****************** In between table ********************

DROP TABLE IF EXISTS `User_InstallSupport`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `User_InstallSupport` (
`installSupport_id` bigint(20) NOT NULL,
`username` varchar(50) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`installSupport_id`,`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin2;




the problem is in fact,that i got users setted on the Installsuportclass...but any persistence is reached on the DB..
I think that may be there is any issue trying to use the key username as long as its an String.... or may be there is a kind of issue or incompatibility between SpringUserdetails and hibernate...

Any Idea?????


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.