[Persistence, JBoss/CMP, Hibernate, Database] - JAR with entities in a WebApp
by yuriy_zubarev
Greetings,
I started a thread in JBoss Seam forum and then I was directed here: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121137.
To summarize, we have Maven managed projects and one project called "entity" only has entity classes in it with JPA annotations. A JAR generated from this project is then used/shared in couple of other projects. The problem here is that "entity".jar contains "persistence.xml" with declarations like these:
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="validate" />
| <property name="hibernate.show_sql" value="true" />
| <property name="hibernate.cache.provider_class"
| value="org.hibernate.cache.HashtableCacheProvider" />
| </properties>
|
But what if we want to use different value for "hibernate.hbm2ddl.auto" when we use "entity".jar in one application (web app A) and yet another value in web app B? I don't think there are ways to override values specified in "entity".jar from an application that is using it, is it correct?
The other question I have is about project organization. Does anyone have a project that only builds JAR with entities and other project using it. Is it a good way to go about organization and code re-use?
Thank you,
Yuriy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100031#4100031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100031
18Â years, 6Â months
[JBoss Seam] - Multiple <s:convertEntity /> from different persistence mana
by jarkkoï¼ jab.fi
Hello,
I'm trying to figure out how use different entity managers with s:convertEntity.
This is from Admin page which uses the adminEntityManager (EM without any restriction filters).
anonymous wrote :
| <h:selectManyListbox value="#{unit.manager}" size="4">
| <s:selectItems value="#{managers}" var="yp" label="#{yp.name}" />
| <s:convertEntity />
| </h:selectManyListbox>
|
Now, this fails because the s:convertEntity has been configured to use (because it's also used elsewhere/other pages) restrictedEntityManager in components.xml.
Is there a way to use "multiple" EntityManagers aka have more than one entityConverter? I couldn't find a way to do that.
anonymous wrote :
| org.hibernate.TransientObjectException: The instance was not associated with this session
| at org.hibernate.impl.SessionImpl.getIdentifier(SessionImpl.java:1375)
| at org.jboss.seam.persistence.HibernatePersistenceProvider.getId(HibernatePersistenceProvider.java:51)
| at org.jboss.seam.framework.EntityIdentifier.(EntityIdentifier.java:15)
| at org.jboss.seam.ui.EntityConverterStore.put(EntityConverterStore.java:61)
| at org.jboss.seam.ui.EntityConverter.getAsString(EntityConverter.java:63)
|
components.xml:
| <component name="org.jboss.seam.ui.entityConverter">
| <property name="entityManager">#{restrictedEntityManager}</property>
| </component>
|
|
| <core:managed-persistence-context name="restrictedEntityManager">
| <core:filters>
| <value>#{disabledFilter}</value>
| </core:filters>
| </core:managed-persistence-context>
|
| <core:managed-persistence-context name="adminEntityManager">
| </core:managed-persistence-context>
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100030#4100030
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100030
18Â years, 6Â months
[Beginners Corner] - USERS and ROLES - why in seperate tables?
by konstandinos
Hi
With users.properties and roles.properties:
It makes sense to have username=password in the former, and username=Role1,Role2,...,RoleN in the latter, because Java's property lookup mechanism works like that.
ie: we cannot have username=password=Role1,Role2,...,RoleN
But now with regards to DatabaseServerLoginModule - why do we need two separate tables, one for USERS and one for ROLES? That's what the wiki / docs recommend and I don't understand why.
I'm repeating usernames in both tables and there is no clear reason for the tables to be separate. I could just as easily have a single table with fields for USERNAME, PASSWORD and ROLES all in one table.
Am I overlooking something? Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100026#4100026
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100026
18Â years, 6Â months
[JBoss Seam] - Re: Writing SeamTests with Seam 2.0.0. CR2 - What's Changed?
by pete.muirï¼ jboss.org
"bsmithjj" wrote : oh yes, one rant - if a specific version of testng is required, then what happened to the days when frameworks listed out their depedencies including versions? Has listing depedencies gone the way of documentation? ;-)
No, we now have a dependencies chapter which discusses common runtime and compile dependencies for your project and pom's which documents the versions and dependencies for compiling and using Seam.
We would like to get a report out of maven that prints out all the jars, but this seems to require us to use snapshot versions of maven plugins. I will add this for 2.0.1
anonymous wrote : it looks like the version of testng supplied with Seam 2.0.0.CR3 is 5.6-200706070953 (from MANIFEST.MF file). The maven2 surefire plugin docs are based on testng 4.7 (which I was using - see previous post in thread).
Yes, surefire is broken and stagnating. I think you have to use the snapshot but don't know - the last working version of testng with the released surefire is 5.1 IIRC.
anonymous wrote : When run from Eclipse I was using JUnit4 and they weren't being called; is TestNG a requirement?
Yes.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100022#4100022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100022
18Â years, 6Â months