[Persistence, JBoss/CMP, Hibernate, Database] - Re: Problems with JPA/Hibernate persist
by jharby1
P.S. I'm using Intellij's ORM generator to create the entity - here is the generated code for that:
| package com.csatp.model;
|
| import javax.persistence.*;
| import java.sql.Timestamp;
|
| @Entity
| @Table(catalog = "WeekOld", schema = "dbo", name = "RECORDLOCK")
| public class RecordlockEntity {
| private int recordlockseqno;
|
| @Id
| @GeneratedValue(strategy=GenerationType.AUTO)
| @Column(name = "recordlockseqno", nullable = false, length = 10)
| public int getRecordlockseqno() {
| return recordlockseqno;
| }
|
| public void setRecordlockseqno(int recordlockseqno) {
| this.recordlockseqno = recordlockseqno;
| }
|
| private String username;
|
| @Basic
| @Column(name = "username", nullable = false, length = 10)
| public String getUsername() {
| return username;
| }
|
| public void setUsername(String username) {
| this.username = username;
| }
|
| private Timestamp lockdate;
|
| @Basic
| @Column(name = "lockdate", nullable = false, length = 23, precision = 3)
| public Timestamp getLockdate() {
| return lockdate;
| }
|
| public void setLockdate(Timestamp lockdate) {
| this.lockdate = lockdate;
| }
|
| private Timestamp expirationdate;
|
| @Basic
| @Column(name = "expirationdate", length = 23, precision = 3)
| public Timestamp getExpirationdate() {
| return expirationdate;
| }
|
| public void setExpirationdate(Timestamp expirationdate) {
| this.expirationdate = expirationdate;
| }
|
| private String recordkey;
|
| @Basic
| @Column(name = "recordkey", nullable = false, length = 30)
| public String getRecordkey() {
| return recordkey;
| }
|
| public void setRecordkey(String recordkey) {
| this.recordkey = recordkey;
| }
|
| private String recordtype;
|
| @Basic
| @Column(name = "recordtype", nullable = false, length = 10)
| public String getRecordtype() {
| return recordtype;
| }
|
| public void setRecordtype(String recordtype) {
| this.recordtype = recordtype;
| }
|
| public boolean equals(Object o) {
| if (this == o) return true;
| if (o == null || getClass() != o.getClass()) return false;
|
| RecordlockEntity that = (RecordlockEntity) o;
|
| if (recordlockseqno != that.recordlockseqno) return false;
| if (expirationdate != null ? !expirationdate.equals(that.expirationdate) : that.expirationdate != null)
| return false;
| if (lockdate != null ? !lockdate.equals(that.lockdate) : that.lockdate != null) return false;
| if (recordkey != null ? !recordkey.equals(that.recordkey) : that.recordkey != null) return false;
| if (recordtype != null ? !recordtype.equals(that.recordtype) : that.recordtype != null) return false;
| if (username != null ? !username.equals(that.username) : that.username != null) return false;
|
| return true;
| }
|
| public int hashCode() {
| int result;
| result = recordlockseqno;
| result = 31 * result + (username != null ? username.hashCode() : 0);
| result = 31 * result + (lockdate != null ? lockdate.hashCode() : 0);
| result = 31 * result + (expirationdate != null ? expirationdate.hashCode() : 0);
| result = 31 * result + (recordkey != null ? recordkey.hashCode() : 0);
| result = 31 * result + (recordtype != null ? recordtype.hashCode() : 0);
| return result;
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192288#4192288
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192288
17 years, 5 months
[JBoss jBPM] - Does AssignmentHandler work within the start node??
by ardavan
Hi,
I can't assign the actorid that I want for a simple start node:
As a test case I am using a simple processdefinition:
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="test">
|
| <start-state name="Submission">
| <task name="taskSubmission">
| <assignment class="jbpm.taskmgmt.EmiliAssignmentHandler"></assignment>
| </task>
| <transition to="Evaluate" name="trEvaluate"></transition>
| </start-state>
|
| <task-node name="Evaluate">
| <task name="evaluateTask">
| <assignment class="jbpm.taskmgmt.ManagerAssignmentHandler"></assignment>
| <controller></controller>
| </task>
| <transition to="end" name="trAbort"></transition>
| </task-node>
|
| <end-state name="end">
| <event type=""></event>
| </end-state>
| </process-definition>
|
My issue is within the task: "taskSubmission" f the start node and the class "EmiliAssignmentHandler":
| package jbpm.taskmgmt;
| import org.jbpm.graph.exe.*;
| import org.jbpm.taskmgmt.def.*;
| import org.jbpm.taskmgmt.exe.Assignable;
|
| public class EmiliAssignmentHandler implements AssignmentHandler {
|
| private static final long serialVersionUID = 1L;
| public void assign(Assignable assignable, ExecutionContext executionContext) {
| assignable.setActorId("emili");
| }
| }
|
I run the JUNIT test:
| + the correct imports...
|
| public class TestCase2 extends junit.framework.TestCase {
|
| static JbpmConfiguration jbpmConfiguration =
| JbpmConfiguration.parseResource("jbpm.cfg.xml");
|
| ... variables ...
| public void setUp() {
| ... same as in jbpm examples
| }
|
| public void tearDown() {
| ... same as in jbpm examples
| }
|
| private void newTransaction() {
| ... same as in jbpm examples
| }
|
| private void deployProcess() {
| ... same as in jbpm examples
| }
|
| private TaskInstance createNewProcessInstance() {
| GraphSession graphSession = jbpmContext.getGraphSession();
| ProcessDefinition processDefinition =
| graphSession.findLatestProcessDefinition("test");
| processInstance =
| new ProcessInstance(processDefinition);
| processInstanceId = processInstance.getId();
| contextInstance = processInstance.getContextInstance();
| taskMgmtInstance = processInstance.getTaskMgmtInstance();
| return processInstance.getTaskMgmtInstance().createStartTaskInstance();
| }
|
| public void testStartSubmissionParameters() {
| TaskInstance taskInstance = createNewProcessInstance();
| assertEquals("taskSubmission", taskInstance.getName());
| assertEquals(0, taskInstance.getVariables().size());
| }
|
| public void testSubmissionTask(){
| TaskInstance taskInstance = createNewProcessInstance();
| taskInstance.setActorId("emili");
| taskInstance.end();
| assertEquals("emili", taskInstance.getActorId()); <----WORKS
| List emiliTasks = jbpmContext.getTaskMgmtSession().findTaskInstances("emili");
| assertEquals(0, emiliTasks.size()); <----WORKS
| }
|
| public void testSubmissionNotWorking(){
| // create a task to start the test process
| TaskInstance taskInstance = createNewProcessInstance();
| assertEquals("emili", taskInstance.getActorId()); <----PROBLEM
| taskInstance.end();
| }
| }
|
Why does taskInstance.getActorId() in method testSubmissionTask() equal null where it should be equal to "emili" because of the EmiliAssignmentHandler class in the "taskSubmission" start node ????
thank you for your help
Ardavan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192287#4192287
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192287
17 years, 5 months
[EJB 3.0] - EJB3 Session Bean as 2.1 Service
by cburnley
I'm deploying a remote ejb3 service (4.2.3) that needs to be called by a legacy ejb 2.1 (4.0.3) client.
I've declared the bean with @Remote and @RemoteHome, and added container-configuration in a jboss.xml but it seems as though the service is still exposed as a ejb3 service because I get these types of exceptions:
anonymous wrote : java.io.InvalidClassException: org.jboss.ejb3.session.BaseSessionRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 831091
| 5813626447181, local class serialVersionUID = 2609262789016232311
|
which would imply that it is not really a 2.1 view of the service because it uses ejb3 proxy classes, making it incompatible with the 4.0.3 client.
Is it even possible to do this with jboss ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192275#4192275
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192275
17 years, 5 months