-
1. Re: SEAM without jpa and hibernate
www.supernovasoftware.com Jan 22, 2009 12:33 AM (in response to knice147)You can still use native SQL with hibernate. I do so frequently.
What do you have against Hibernate or JPA? They make my life much easier.
-
2. Re: SEAM without jpa and hibernate
knice147 Jan 22, 2009 3:45 AM (in response to knice147)I make use of alot of stored procedures. In a nutshell, I have a utility that wraps up the process of stored procedures and would rather use this instead of EntityManager. So I would rather use this without jpa or hibernate. Would this be possible?
-
3. Re: SEAM without jpa and hibernate
www.supernovasoftware.com Jan 22, 2009 3:58 AM (in response to knice147)Should be possible. I would just get my application working with hibernate included. Then try to strip it out if you really must. You can load an object directly to a form and use Seam to inject it into a component and persist it trivially. The reverse is just a trivial. You can still make use of all your stored procedures and you will not be forced to use the entity manager or even map any entities if you don't want to.
-
4. Re: SEAM without jpa and hibernate
knice147 Jan 22, 2009 4:27 AM (in response to knice147)is there anything special I need for the persistence.xml file? Correct me if I am wrong, but it seems like it creates one instance of an EntityManager, and you reference that one by name in your action beans. It seems almost like it somehow adds the EntityManager to the application scope. Would I need to turn off this functionality to use say JDBC and CallableStatements instead of EntityManager or can I specify the object I frequently use in the persistance.xml file and have it use this instead of EntityManager.
-
5. Re: SEAM without jpa and hibernate
malex Jan 22, 2009 10:06 AM (in response to knice147)In one of our projects we completey avoid using of Seam/EJB3 persistance mechanisms (the app runs with a framework having its own), but benefit from all the great rest of the Seam functionality, like component handling/wireing, Email, PDF rendering, and so on (I know, we use miss one of strongest points of Seam ;)).
However, in that case we have to switch off transaction handling in Seam:
components.xml:
<core:init debug="true" transaction-management-enabled="false"/>
<transaction:no-transaction/> -
6. Re: SEAM without jpa and hibernate
knice147 Jan 22, 2009 4:47 PM (in response to knice147)I cant thank you enough for that piece of information. Ive been pulling my hair out on this. Is there anything else I need to configure? Also, are you just replacing the EntityManager on any given Action Bean with you persistence mechanism? Are you letting SEAM allocate the persistence manager using the @IN annotation or are you actually allocating it as you need it?
Marcus Spiegel wrote on Jan 22, 2009 10:06:
In one of our projects we completey avoid using of Seam/EJB3 persistance mechanisms (the app runs with a framework having its own), but benefit from all the great rest of the Seam functionality, like component handling/wireing, Email, PDF rendering, and so on (I know, we use miss one of strongest points of Seam ;)).
However, in that case we have to switch off transaction handling in Seam:
-
7. Re: SEAM without jpa and hibernate
knice147 Jan 22, 2009 11:25 PM (in response to knice147)Also can you refer me to any online docs and examples you might have used to achieve this functionality?