[JBoss Seam] - selectOneMenu Question
by KoniKoni
I shoud like to implement selection from first selectOneMenu, object of which is supplied contains
a list, this is spent with the second selectOneMenu.
The first menu functions and the second not, maybe somebody can help me.
Here is my code:
Component:
<framework:entity-query name="allHer"
| ejbql="select h from Hersteller h"
| order="h.bezeichnung" >
| </framework:entity-query>
View:
<ui:define name="main">
| <s:link value="zurueck" view="/home"/>
|
| <s:div>
| <a4j:region>
| <s:div id="frm">
| <a4j:form>
| <h:selectOneMenu value="#{hersteller}">
| <s:convertEntity />
| <s:selectItems value="#{allHer.resultList}" var="her" label="#{her.bezeichnung}" noSelectionLabel="Bitte waehlen..." />
| <a4j:support event="onchange" action="#{fahrzeugact.setModel}" reRender="msg,frm1">
| <s:conversationPropagation type="join" /> </a4j:support>
| </h:selectOneMenu>
|
|
| </a4j:form>
| </s:div>
| </a4j:region>
|
| <a4j:region>
| <s:div id="frm1">
| <a4j:form>
| <h:selectOneMenu value="#{kmd}" disabled="#{empty hersteller.kfzmodel}">
| <s:convertEntity />
| <s:selectItems value="#{hersteller.kfzmodel}" var="md" label="#{md.bezeichnung}" noSelectionLabel="Bitte waehlen..." />
| <a4j:support event="onchange" action="#{fahrzeugact.setModel1}" reRender="msg">
| <s:conversationPropagation type="join" /> </a4j:support>
| </h:selectOneMenu>
| </a4j:form>
| </s:div>
| </a4j:region>
|
|
| <a4j:region>
|
| <s:div id="msg"><h:messages globalOnly="false"/> </s:div>
| </a4j:region>
| </s:div>
| </ui:define>
|
|
| Session:
|
|
| @Name("fahrzeugact")
| | @Stateful
| | public class Fahrzeug implements FahrzeugInterface {
| | @DataModel
| | private List<Hersteller> hrList;
| |
| | private List<Hersteller> hrsList;
| |
| | @In(required=false)
| | private KfzModel kmd;
| |
| | @PersistenceContext
| | private EntityManager em;
| |
| | @In(required=false)
| | private Hersteller hersteller;
| |
| |
| |
| | @Begin
| | public List<Hersteller> getHrsList() {
| | return em.createQuery("from Hersteller where akzept = true").getResultList();
| | }
| |
| |
| | public void setModel(){
| | // md
| | System.out.println("--------------- " + hersteller.getBezeichnung());
| | }
| |
| | public void setModel1(){
| | // md
| |
| | System.out.println("--------------- 1 " + kmd.getBezeichnung());
| | }
| |
| | @End
| | public void reset() {}
| |
| | @Destroy
| | @Remove
| | public void destroy() {}
| | }
| |
I believe that it is because of different contexts, I must in component.xml defined inquiry to tie, white however not how. And if I define the whole over factories, then over messages on the side one spends: invalid value.
I have the example ?UI? looked at, there am realized it over HomeEntity. How can I realize this completely on source code level, without HomeEntity?
Or think I there in wrong direction?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031382#4031382
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031382
19Â years
[JBoss/Spring Integration] - Re: Problem persisting data using Spring + Hibernate JPA
by alesj
"suneetshah" wrote :
| Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.service (STATUS, SERVICE_NAME, LOCATION_IP_ADDRESS, COMPANY_OWNER_ID, START_DAT' at line 1
| at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:896)
| at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
| ... 37 more
|
| ----------Generated SQL:----------------------
| Hibernate: insert into mysql.mysql.service (STATUS, SERVICE_NAME, LOCATION_IP_ADDRESS, COMPANY_OWNER_ID, START_DATE, END_DATE, LICENSE_KEY, SERVICE_TYPE, PARENT_SERVICE_ID, ROOT_RESOURCE_ID, ACCESS_CONTROL_MODEL, PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, SERVICE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031380#4031380
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031380
19Â years
[JBoss/Spring Integration] - Re: Problem persisting data using Spring + Hibernate JPA
by suneetshah
The exception is pasted below.
Thanks.
org.springframework.transaction.UnexpectedRollbackException: JPA transaction unexpectedly rolled back (maybe marked rollback-only after a failed operation); nested exception is javax.persistence.RollbackException: Error while commiting the transaction
Caused by: javax.persistence.RollbackException: Error while commiting the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:427)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:651)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:621)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:311)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:628)
at diamelle.common.service.ServiceMgr$$EnhancerByCGLIB$$2f734b75.addService()
at test.diamelle.common.service.ServiceMgrTest.testAddService(ServiceMgrTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
... 29 more
Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.service (STATUS, SERVICE_NAME, LOCATION_IP_ADDRESS, COMPANY_OWNER_ID, START_DAT' at line 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:896)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 37 more
----------Generated SQL:----------------------
Hibernate: insert into mysql.mysql.service (STATUS, SERVICE_NAME, LOCATION_IP_ADDRESS, COMPANY_OWNER_ID, START_DATE, END_DATE, LICENSE_KEY, SERVICE_TYPE, PARENT_SERVICE_ID, ROOT_RESOURCE_ID, ACCESS_CONTROL_MODEL, PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, SERVICE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031373#4031373
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031373
19Â years