-->
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: Problem with access to database
PostPosted: Mon Jan 21, 2008 6:04 pm 
Newbie

Joined: Thu Jan 10, 2008 7:48 pm
Posts: 3
Hello everyone, I'm writing my first big webapplication using spring and hibernate, and I have problem. Let's consider this situation:

I have two tables joined with third one (many to many relation), with hibernate mappings:

students:
Code:
- studentId
- firstName
... and other personal data

studentsInClass:
Code:
- classId
... and other data

After all I have two classes: Student and StudentInClass. Student has got field: private Set inClasses, which contains all studentInClass objects connected to student. StudentInClass has fields containing reference to student data.

Now I want to use that data, I just use HibernateTemplate and I put Student object to ModelAndView. In jsp file i can simply present student data: for example ${student.firstName} etc. But I also could access studentInClass object ${student.inClasses} is simple forEach loop. Moreover nothing can stop me to access students object connected to that class etc. I could get all data from database, using tables relation and I think it is not ok

What I can do? What I'm doing wrong? How I can block access, that student can see only his data, and his class info, but not other students. , I know, that I can write properly jsp, but it is not the solution? Could acegi module help me?


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.