Methods Summary |
---|
protected com.oreilly.jent.transactions.domain.PersonValue | createPerson(com.oreilly.jent.transactions.domain.PersonValue aPersonValue)
sLogger.info("5 creating person in manager cmtd bean ...");
try {
InitialContext aInitialContext = new InitialContext();
PersonHome aPersonHome = (PersonHome) aInitialContext.lookup("java:comp/env/ejb/Person");
Person p = aPersonHome.create(aPersonValue.getEmail(), aPersonValue.getPassword());
p.setWorkPhone(aPersonValue.getWorkPhone());
p.setHomePhone(aPersonValue.getHomePhone());
sLogger.info("Created a person with id : " + p.getPersonId());
aPersonValue.setPersonId(p.getPersonId());
} catch (Exception e) {
String aMessage = "exception occured in manager cmtd bean.createPersonNewTransaction ";
sLogger.log(Level.SEVERE, aMessage, e);
throw new EJBException(aMessage, e);
}
return aPersonValue;
|
public com.oreilly.jent.transactions.domain.PersonValue | createPersonAndStatus(com.oreilly.jent.transactions.domain.PersonValue aPersonValue, com.oreilly.jent.transactions.domain.PersonStatusValue aPersonStatusValue)
aPersonValue = createPersonNewTransaction(aPersonValue);
aPersonStatusValue = createPersonStatus(aPersonValue,
aPersonStatusValue);
return aPersonValue;
|
public com.oreilly.jent.transactions.domain.PersonValue | createPersonAndStatusNew(com.oreilly.jent.transactions.domain.PersonValue aPersonValue, com.oreilly.jent.transactions.domain.PersonStatusValue aPersonStatusValue)
aPersonValue =
((ManagerCMTD) mSessionContext.getEJBObject()).createPersonNewTransaction(
aPersonValue);
aPersonStatusValue = createPersonStatus(aPersonValue,
aPersonStatusValue);
return aPersonValue;
|
public com.oreilly.jent.transactions.domain.PersonValue | createPersonNewTransaction(com.oreilly.jent.transactions.domain.PersonValue aPersonValue)
return createPerson(aPersonValue);
|
public com.oreilly.jent.transactions.domain.PersonValue | createPersonSameTransaction(com.oreilly.jent.transactions.domain.PersonValue aPersonValue)
return createPerson(aPersonValue);
|
protected com.oreilly.jent.transactions.domain.PersonStatusValue | createPersonStatus(com.oreilly.jent.transactions.domain.PersonValue aPersonValue, com.oreilly.jent.transactions.domain.PersonStatusValue aPersonStatusValue)
try {
InitialContext aInitialContext = new InitialContext();
PersonHome aPersonHome = (PersonHome) aInitialContext.lookup("java:comp/env/ejb/Person");
Person aPerson = aPersonHome.findByPrimaryKey(aPersonValue.getPersonId());
PersonStatusHome aPersonStatusHome = (PersonStatusHome) aInitialContext.lookup(
"java:comp/env/ejb/PersonStatus"
);
PersonStatus aPersonStatus = aPersonStatusHome.create(aPerson);
aPersonStatus.setStatus(aPersonStatusValue.getStatus());
aPersonStatus.setStatusComment(aPersonStatusValue.getStatusComment());
aPersonStatusValue.setId(aPersonStatus.getPersonStatusId());
aPersonValue.setPersonStatusValue(aPersonStatusValue);
return aPersonStatusValue;
} catch (Exception e) {
String aMessage = "exception occured in manager cmtd bean. create person and status";
sLogger.log(Level.SEVERE, aMessage, e);
throw new EJBException (aMessage, e);
}
|
public void | ejbActivate()
|
public void | ejbCreate()
|
public void | ejbPassivate()
|
public void | ejbRemove()
|
public java.util.Collection | getAllPersons()
sLogger.info("creating person in manager cmtd bean. find all person...");
Collection c = new ArrayList();
try {
InitialContext aInitialContext = new InitialContext();
PersonHome aPersonHome = (PersonHome) aInitialContext.lookup("java:comp/env/ejb/Person");
Collection aPersonCollection = aPersonHome.findAll();
Iterator i = aPersonCollection.iterator();
while (i.hasNext()) {
Person aPerson = (Person) i.next();
c.add(toValue(aPerson));
}
} catch (Exception e) {
String aMessage = "exception occured in manager cmtd bean.find all person";
sLogger.log(Level.SEVERE, aMessage, e);
throw new EJBException(aMessage, e);
}
return c;
|
public void | setSessionContext(javax.ejb.SessionContext aSessionContext)
mSessionContext = aSessionContext;
|
protected com.oreilly.jent.transactions.domain.PersonValue | toValue(com.oreilly.jent.transactions.domain.Person aPerson)
PersonValue aPersonValue = new PersonValue();
if (aPerson != null) {
aPersonValue.setEmail(aPerson.getEmail());
aPersonValue.setFAX(aPerson.getFAX());
aPersonValue.setHomePhone(aPerson.getHomePhone());
//aPersonValue.setPassword(aPerson.getPassword());
aPersonValue.setPersonId(aPerson.getPersonId());
aPersonValue.setWorkPhone(aPerson.getWorkPhone());
aPersonValue.setPersonStatusValue(toValue(aPerson.getPersonStatus()));
}
return aPersonValue;
|
protected com.oreilly.jent.transactions.domain.PersonStatusValue | toValue(com.oreilly.jent.transactions.domain.PersonStatus aLocal)
PersonStatusValue aValue = new PersonStatusValue();
if (aLocal != null) {
aValue.setId(aLocal.getPersonStatusId());
aValue.setStatus(aLocal.getStatus());
aValue.setStatusComment(aLocal.getStatusComment());
}
return aValue;
|