In order to create an entity bean corresponding to a table inside the database, you should use a tool which knows how to generate the interfaces and the bean class. You could use JBuilder with the plugin for JBoss (JBossOpenTool.jar) and classes12.jar for Oracle. Or you could use other tools for generating the bean. Of course, you could write all these files by hand but you shouldn't because it's really easy to make mistakes and it will be pretty hard to find the problems. Try and find some tools that can help you. I hear XDoctlet it's a pretty good one. I've just never used it.