📄 employee_az16cs__weblogic_cmp_rdbms_employeepermcmp_set.java
字号:
if (!(o instanceof testejb.EmployeePermcmp))
return false;
try {
EJBLocalObject eo = (EJBLocalObject)o;
if (__WL_cache !=null) {
EloWrapper wrap = new EloWrapper(eo);
return __WL_cache.contains(wrap);
}
else {
testejb.EmployeePermcmp_1ny90w_Intf __WL_bean = (testejb.EmployeePermcmp_1ny90w_Intf)
__WL_bm.lookup(eo.getPrimaryKey());
try {
__WL_bean.__WL_checkExistsOnMethod();
}
catch (NoSuchEntityException nsee) {
Loggable l = EJBLogger.logbeanDoesNotExistLoggable("EmployeePermcmp",eo.getPrimaryKey().toString());
throw new IllegalArgumentException(l.getMessage());
}
int oldState = __WL_bean.__WL_getMethodState();
try {
__WL_bean.__WL_setMethodState(WLEnterpriseBean.STATE_BUSINESS_METHOD);
if (__WL_createPk.equals(__WL_bean.getEmployeeId())) {
return true;
}
else {
return false;
}
} finally {
__WL_bean.__WL_setMethodState(oldState);
}
}
} catch (RuntimeException re) {
if (__WL_verbose) {
Debug.say("rethrowing RuntimeException.");
re.printStackTrace();
}
throw re;
} catch (Exception ex) {
if (__WL_verbose) {
Debug.say("wrapping Exception in PersistenceRuntimeException.");
ex.printStackTrace();
}
throw new PersistenceRuntimeException(ex);
}
}
public boolean containsAll(Collection eos) {
checkTransaction();
if (eos==null)
return true;
Iterator iter = eos.iterator();
while (iter.hasNext()) {
if (!contains(iter.next())) {
return false;
}
}
return true;
}
public boolean equals(Object o) {
checkTransaction();
if (!(o instanceof Employee_az16cs__WebLogic_CMP_RDBMS_employeePermcmp_Set))
return false;
Employee_az16cs__WebLogic_CMP_RDBMS_employeePermcmp_Set other = (Employee_az16cs__WebLogic_CMP_RDBMS_employeePermcmp_Set)o;
if (__WL_cache==null)
populateCache();
if (other.__WL_cache==null)
other.populateCache();
return __WL_cache.equals(other.__WL_cache);
}
public int hashCode() {
checkTransaction();
if (__WL_cache==null)
populateCache();
return __WL_cache.hashCode();
}
public boolean isEmpty() {
checkTransaction();
if (__WL_cache==null)
populateCache();
return __WL_cache.isEmpty();
}
public boolean remove(Object o)
{
return remove(o, false);
}
public boolean remove(Object o, boolean ejbStore)
{
return remove(o, ejbStore, true);
}
// The flag 'remove' controls whether the Relationship's
// underlying __WL_cache does a remove() operation.
// If an Iterator of the __WL_cache is used to effect a remove()
// then we must be sure to not do a __WL_cache.remove()
// that is the intended use of the 'remove' flag.
public boolean remove(Object o, boolean ejbStore, boolean remove)
{
checkTransaction();
if (o==null)
throw new IllegalArgumentException();
if (!(o instanceof testejb.EmployeePermcmp))
throw new IllegalArgumentException(
"Attempted to add an object of type '" +
o.getClass().getName() +
"' to collection, but the type must be '" +
"testejb.EmployeePermcmp' instead.");
try {
EJBLocalObject eo = (EJBLocalObject)o;
testejb.EmployeePermcmp_1ny90w_Intf __WL_bean = (testejb.EmployeePermcmp_1ny90w_Intf)
__WL_bm.lookup(eo.getPrimaryKey());
try {
__WL_bean.__WL_checkExistsOnMethod();
}
catch (NoSuchEntityException nsee) {
Loggable l = EJBLogger.logbeanDoesNotExistLoggable("EmployeePermcmp",eo.getPrimaryKey().toString());
throw new IllegalArgumentException(l.getMessage());
}
int oldState = __WL_bean.__WL_getMethodState();
try {
__WL_bean.__WL_setMethodState(WLEnterpriseBean.STATE_BUSINESS_METHOD);
if (!__WL_createPk.equals(__WL_bean.getEmployeeId())) {
return false;
}
else {
__WL_bean.__WL_setEmployeeBean_employeePermcmp(null, ejbStore, remove);
return true;
}
} finally {
__WL_bean.__WL_setMethodState(oldState);
}
} catch (RuntimeException re) {
if (__WL_verbose) {
Debug.say("rethrowing RuntimeException.");
re.printStackTrace();
}
throw re;
} catch (Exception ex) {
if (__WL_verbose) {
Debug.say("wrapping Exception in PersistenceRuntimeException.");
ex.printStackTrace();
}
throw new PersistenceRuntimeException(ex);
}
}
public boolean removeAll(Collection col) {
checkTransaction();
if (col==null)
return false;
boolean changed = false;
Iterator iter = col.iterator();
while (iter.hasNext()) {
changed |= remove(iter.next(), false);
}
return changed;
}
public boolean retainAll(Collection c) {
checkTransaction();
Iterator iter = iterator();
List toRemove = new ArrayList();
while (iter.hasNext()) {
EJBLocalObject eo = (EJBLocalObject)iter.next();
if (c != null && !c.contains(eo)) {
toRemove.add(eo);
}
}
Iterator remIter = toRemove.iterator();
boolean changed = false;
while (remIter.hasNext()) {
EJBLocalObject eo = (EJBLocalObject)remIter.next();
changed |= this.remove(eo);
}
return changed;
}
public int size() {
checkTransaction();
if (__WL_cache==null)
populateCache();
return __WL_cache.size();
}
public Object[] toArray()
{
if (__WL_verbose) Debug.say("toArray() called.");
checkTransaction();
if (__WL_cache==null) populateCache();
int i = 0;
Object[] arry = new Object[__WL_cache.size()];
Iterator iter = __WL_cache.iterator();
while (iter.hasNext()) {
EloWrapper wrap = (EloWrapper)iter.next();
arry[i++] = wrap.getEJBLocalObject();
}
return arry;
}
public Object[] toArray(Object[] a)
{
if (__WL_verbose) Debug.say("toArray() called.");
checkTransaction();
if (a==null)
throw new ArrayStoreException(
"Null argument passed to Employee_az16cs__WebLogic_CMP_RDBMS_employeePermcmp_Set.toArray");
try {
Class toClass = a.getClass().getComponentType();
if (__WL_cache==null) populateCache();
if (a.length<__WL_cache.size())
a = (Object[])Array.newInstance(toClass, __WL_cache.size());
int i = 0;
Iterator iter = __WL_cache.iterator();
while (iter.hasNext()) {
EloWrapper wrap = (EloWrapper)iter.next();
testejb.EmployeePermcmp elem =
(testejb.EmployeePermcmp)wrap.getEJBLocalObject();
if (i==0) {
Class colClass = elem.getClass();
if (!toClass.isAssignableFrom(colClass)) {
throw new ArrayStoreException(
"Argument type '" +
toClass.getName() +
"' passed to Employee_az16cs__WebLogic_CMP_RDBMS_employeePermcmp_Set.toArray " +
"is not a superclass of the element type of the collection '" +
colClass.getName() +
"'.");
}
}
a[i++] = elem;
}
while (i<a.length) {
a[i++] = null;
}
return a;
} catch (RuntimeException re) {
if (__WL_verbose) {
Debug.say("rethrowing RuntimeException.");
re.printStackTrace();
}
throw re;
} catch (Exception ex) {
if (__WL_verbose) {
Debug.say("wrapping Exception in PersistenceRuntimeException.");
ex.printStackTrace();
}
throw new PersistenceRuntimeException(ex);
}
}
private void checkTransaction()
{
Transaction tx = TransactionHelper.getTransactionHelper().getTransaction();
if (tx==null) {
Loggable l = EJBLogger.logaccessedCmrCollectionOutsideTransactionLoggable("Employee", "employeePermcmp");
throw new IllegalStateException(
l.getMessage());
}
if (!tx.equals(__WL_createTx) && ! false ) {
Loggable l1 = EJBLogger.logaccessedCmrCollectionInDifferentTransactionLoggable("Employee", "employeePermcmp");
throw new IllegalStateException(
l1.getMessage());
}
}
public boolean checkIfCurrentTxEqualsCreateTx(javax.transaction.Transaction currentTx) {
if(currentTx != null && currentTx.equals(__WL_createTx))
return true;
else
return false;
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
private void writeObject(java.io.ObjectOutputStream out)
throws IOException
{
throw new EJBException(
"Attempt to serialize a collection that implements a cmr-field. " +
"Collections managed by the CMP RDBMS persistence manager may not " +
"be passed directly to a remote client.");
}
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException
{
// this method is never called
throw new EJBException(
"Attempt to serialize a collection that implements a cmr-field. " +
"Collections managed by the CMP RDBMS persistence manager may not " +
"be passed directly to a remote client.");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -