The reason I pointed you to Hibernate was because JBoss EJB3 doesn't handle any of the persistence related logic and it's the JPA provider (by default in JBoss AS, it's Hibernate) that manages this :) So any question related to JPA queries or tables will have more chances of being answered in a JPA provider forum.