/** Allocate the property to a list. */ private void allocateToList(BeanProperty prop) { if (prop.isTransient()) { transients.add(prop); if (prop.isDraft()) { draft = prop; } return; } if (prop.isId()) { ids.add(prop); return; } else { nonTransients.add(prop); } if (prop.isMutableScalarType()) { mutable.add(prop); } if (desc.getInheritInfo() != null && prop.isLocal()) { local.add(prop); } if (prop instanceof BeanPropertyAssocMany<?>) { manys.add((BeanPropertyAssocMany<?>) prop); } else { nonManys.add(prop); if (prop instanceof BeanPropertyAssocOne<?>) { BeanPropertyAssocOne<?> assocOne = (BeanPropertyAssocOne<?>) prop; if (prop.isEmbedded()) { embedded.add(assocOne); } else { ones.add(assocOne); if (!assocOne.isOneToOneExported()) { onesImported.add(assocOne); } } } else { // its a "base" property... if (prop.isVersion()) { if (versionProperty == null) { versionProperty = prop; } else { logger.warn( "Multiple @Version properties - property " + prop.getFullBeanName() + " not treated as a version property"); } } else if (prop.isDraftDirty()) { draftDirty = prop; } if (prop instanceof BeanPropertyCompound) { baseCompound.add((BeanPropertyCompound) prop); } else { baseScalar.add(prop); } } } }
private BeanPropertyAssocOne<?>[] getOne(boolean imported, Mode mode) { ArrayList<BeanPropertyAssocOne<?>> list = new ArrayList<BeanPropertyAssocOne<?>>(); for (int i = 0; i < ones.size(); i++) { BeanPropertyAssocOne<?> prop = ones.get(i); if (imported != prop.isOneToOneExported()) { switch (mode) { case Save: if (prop.getCascadeInfo().isSave()) { list.add(prop); } break; case Delete: if (prop.getCascadeInfo().isDelete()) { list.add(prop); } break; default: break; } } } return (BeanPropertyAssocOne[]) list.toArray(new BeanPropertyAssocOne[list.size()]); }