Regarding option #1--you probably don't want to simply include a "where client 
id = ?" in all your queries--what if you forget in once place, and expose data 
improperly?

Instead, look at the restricted entity manager in the wiki example, which 
applies a filter to all queries that use it.  The configuration of the 
restricted entity manger is in components.xml, as follows:

    <core:managed-persistence-context name="restrictedEntityManager"
                                      auto-create="true"
                                      
entity-manager-factory="#{wikiEntityManagerFactory}">
        <core:filters>#{accessLevelFilter}</core:filters>
    </core:managed-persistence-context>


Setting up a filter is described starting on page 540 of the Java Persistence 
with Hibernate book--I highly recommend it.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048703#4048703

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048703
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to