[EJB 3.0] - GeneratedValue within Embedded Id
by hitman_in_wis
My company has a table that has a primary key of 5 columns, one of which is an auto-generated sequence. This was not always an auto-generated sequence, and previously was only unique for any combination of the first 4 columns, not unique for the entire table. Therefore, the primary key of the table cannot be simply changed to this one sequence column. However, the column is part of the primary key, and it is unique for any rows forward.
My entity based on this table has an embedded id which encompases the five columns, one of which is the sequence column. Is it possible for me to use a sequence generator to generate the value for this column within the embedded id?
Ive tried putting the necessary sequence annotations in the embedded object, but they are ignored. I dont believe there is any place to put the sequence annotations within the AttributeOverrides of the entity object. Therefore, I'm guessing the only way to populate the column will be for me to manually retrieve the next sequence from the database and set it myself. Is this correct?
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972375#3972375
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972375
19 years, 7 months
[EJB 3.0] - Embeddable EJB3 Alpha 9 in JUnit
by thunderbear
Hi,
I'm getting
anonymous wrote : java.lang.RuntimeException: java.lang.NoSuchMethodError: org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.addSchemaInitializer(Ljava/lang/String;Ljava/lang/String;)V
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:386)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
| at junit.framework.TestResult.runProtected(TestResult.java:128)
| at junit.extensions.TestSetup.run(TestSetup.java:27)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: java.lang.NoSuchMethodError: org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.addSchemaInitializer(Ljava/lang/String;Ljava/lang/String;)V
| at org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory.addSchema(SingletonSchemaResolverFactory.java:83)
| at org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory.addSchema(SingletonSchemaResolverFactory.java:104)
| at org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory.(SingletonSchemaResolverFactory.java:61)
| at org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory.(SingletonSchemaResolverFactory.java:41)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.(BeanXMLDeployer.java:53)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:370)
|
when trying to run EJB3StandaloneBootstrap in a JUnit TestCase.
Is the wrong version of jbossxb.jar bundled in jboss-ejb3-all.jar?
Anyone experiencing the same?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972372#3972372
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972372
19 years, 7 months
[JBoss Seam] - PAGE scope DataModel's selection not correct
by Holy Joe
I've got a PAGE scope DataModel which was working fine until I added an inputText tag to the page. Now the selection is always the first one on the list. I know I've had some trouble understanding exactly how DataModels (and Seam in general, really) works, so I thought I'd post this here to see if someone can educate me before I declare that there's a bug.
I've boiled my code down to isolate the problem. I have this bean:
| @Stateful
| @Scope(ScopeType.SESSION)
| @Name("foo")
| public class FooBean implements Serializable, Foo
| {
| static final long serialVersionUID = -6536629890251170098L;
|
| private static Log log = LogFactory.getLog(FooBean.class);
|
| public FooBean()
| {
| }
|
| private String text;
| public String getText()
| {
| return text;
| }
| public void setText(String text)
| {
| this.text = text;
| }
|
| @DataModel(scope=ScopeType.PAGE)
| List<String> names;
| @DataModelSelection
| private String selectedName;
|
| public String dummy()
| {
| log.debug("Selected name is " + selectedName);
| return null;
| }
|
| @Factory("names")
| public void refresh() {
| names = new LinkedList<String>();
| names.add("Fred");
| names.add("Wilma");
| names.add("Barney");
| names.add("Betty");
| }
|
| @Destroy
| @Remove
| public void destroy()
| {
| }
| }
|
and this page:
| <body>
| <h:form>
| <!-- <h:inputText value="#{foo.text}"/> -->
| <h:dataTable value="#{names}" var="name">
| <h:column>
| <f:facet name="header">
| <h:outputText value="Name" />
| </f:facet>
| <h:outputText value="#{name}" />
| </h:column>
|
| <h:column>
| <f:facet name="header">
| <h:outputText value="Action"/>
| </f:facet>
| <h:commandButton action="#{foo.dummy}" value="Test"/>
| </h:column>
| </h:dataTable>
| </h:form>
| </body>
|
It works fine unless I un-comment the inputText field, in which case the dummy() method always reports that I selected the first name.
What am I doing wrong?
Thanks,
Joe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972370#3972370
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972370
19 years, 7 months