Package com.avaje.ebean.bean

Examples of com.avaje.ebean.bean.EntityBean


    if (exportedProperties.length == 1) {
      q.setParameter(pos++, parentId);

    } else {

      EntityBean parent = (EntityBean) parentId;
      for (int i = 0; i < exportedProperties.length; i++) {
        Object embVal = exportedProperties[i].getValue(parent);
        q.setParameter(pos++, embVal);
      }
    }
View Full Code Here


   * This returns the number of associations deleted.
   * </p>
   */
  public int deleteManyToManyAssociations(Object ownerBean, String propertyName, Transaction t) {

    EntityBean owner = checkEntityBean(ownerBean);
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      int rc = persister.deleteManyToManyAssociations(owner, propertyName, trans);
      wrap.commitIfCreated();
View Full Code Here

   * Save the associations of a ManyToMany given the owner bean and the
   * propertyName of the ManyToMany collection.
   */
  public void saveManyToManyAssociations(Object ownerBean, String propertyName, Transaction t) {

    EntityBean owner = checkEntityBean(ownerBean);
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;

      persister.saveManyToManyAssociations(owner, propertyName, trans);
View Full Code Here

    saveAssociation(ownerBean, propertyName, null);
  }

  public void saveAssociation(Object ownerBean, String propertyName, Transaction t) {

    EntityBean owner = checkEntityBean(ownerBean);
   
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      persister.saveAssociation(owner, propertyName, trans);
View Full Code Here

    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      int saveCount = 0;
      while (it.hasNext()) {
        EntityBean bean = checkEntityBean(it.next());
        persister.save(bean, trans);
        saveCount++;
      }

      wrap.commitIfCreated();
View Full Code Here

    try {
      SpiTransaction trans = wrap.transaction;
      int deleteCount = 0;
      while (it.hasNext()) {
        EntityBean bean = checkEntityBean(it.next());
        persister.delete(bean, trans);
        deleteCount++;
      }

      wrap.commitIfCreated();
View Full Code Here

    }
    return getBeanDescriptor(typeInfo.getBeanType()) != null;
  }

  public Object getBeanId(Object bean) {
    EntityBean eb = checkEntityBean(bean);
    BeanDescriptor<?> desc = getBeanDescriptor(bean.getClass());
    if (desc == null) {
      String m = bean.getClass().getName() + " is NOT an Entity Bean registered with this server?";
      throw new PersistenceException(m);
    }
View Full Code Here

    return bean;
  }

  public Object elGetReference(EntityBean bean) {
   
    EntityBean prevBean = bean;
    for (int i = 0; i < last; i++) {
      // always return non null prevBean
      prevBean = (EntityBean)chain[i].elGetReference(prevBean);
    }
    // try the last step in the chain
View Full Code Here

    }
  }
 
  public void elSetValue(EntityBean bean, Object value, boolean populate) {

    EntityBean prevBean = bean;
    if (populate){
      for (int i = 0; i < last; i++) {
        // always return non null prevBean
        prevBean = (EntityBean)chain[i].elGetReference(prevBean);
     
View Full Code Here

    if (lazyLoadParent != null) {
      lazyLoadParentId = lazyLoadParent.getBeanDescriptor().getIdBinder().read(ctx);
    }
   
    // bean already existing in the persistence context
    EntityBean contextBean = null;

    Class<?> localType;
    BeanDescriptor<?> localDesc;
    IdBinder localIdBinder;
    EntityBean localBean;

    if (inheritInfo != null) {
      InheritInfo localInfo = inheritInfo.readType(ctx);
      if (localInfo == null) {
        // the bean must be null
View Full Code Here

TOP

Related Classes of com.avaje.ebean.bean.EntityBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.