Package com.alvazan.orm.api.exc

Examples of com.alvazan.orm.api.exc.ChildWithNoPkException


    byte[] byteVal = classMeta.convertEntityToId(proxy);
    if(byteVal == null) {
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+classMeta.getMetaClass().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" which has an entity in the collection that does not yet have a primary key so you cannot save it. \n" +
          "The offending object is="+proxy+"   To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
View Full Code Here


      //if value is not null but we get back a byteVal of null, it means the entity has not been
      //initialized with a key yet, BUT this is required to be able to save this object
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+field.getType().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" that does not yet have a primary key so you cannot save it.  To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
              "\nmethod #2 is used for when you have a bi-directional relationship where each is a child of the other");
View Full Code Here

    byte[] byteVal = classMeta.convertEntityToId(proxy);
    if(byteVal == null) {
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+classMeta.getMetaClass().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" which has an entity in the collection that does not yet have a primary key so you cannot save it. \n" +
          "The offending object is="+proxy+"   To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
View Full Code Here

      //if value is not null but we get back a byteVal of null, it means the entity has not been
      //initialized with a key yet, BUT this is required to be able to save this object
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+field.getType().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" that does not yet have a primary key so you cannot save it.  To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
              "\nmethod #2 is used for when you have a bi-directional relationship where each is a child of the other");
View Full Code Here

      //if value is not null but we get back a byteVal of null, it means the entity has not been
      //initialized with a key yet, BUT this is required to be able to save this object
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+field.getType().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" that does not yet have a primary key so you cannot save it.  To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
              "\nmethod #2 is used for when you have a bi-directional relationship where each is a child of the other");
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public byte[] translateValue(Object value) {
    byte[] pk = classMeta.convertEntityToId((PROXY) value);
    if(pk == null && value != null) {
      throw new ChildWithNoPkException("You can't give us an entity with no pk!!!!  We use the pk to search the database index.  Please fix your bug");
    }
    return pk;
  }
View Full Code Here

    byte[] byteVal = classMeta.convertEntityToId(proxy);
    if(byteVal == null) {
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+classMeta.getMetaClass().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" which has an entity in the collection that does not yet have a primary key so you cannot save it. \n" +
          "The offending object is="+proxy+"   To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
View Full Code Here

      //if value is not null but we get back a byteVal of null, it means the entity has not been
      //initialized with a key yet, BUT this is required to be able to save this object
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+field.getType().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" that does not yet have a primary key so you cannot save it.  To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
              "\nmethod #2 is used for when you have a bi-directional relationship where each is a child of the other");
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public byte[] translateValue(Object value) {
    byte[] pk = classMeta.convertEntityToId((PROXY) value);
    if(pk == null && value != null) {
      throw new ChildWithNoPkException("You can't give us an entity with no pk!!!!  We use the pk to search the database index.  Please fix your bug");
    }
    return pk;
  }
View Full Code Here

      //if value is not null but we get back a byteVal of null, it means the entity has not been
      //initialized with a key yet, BUT this is required to be able to save this object
      String owner = "'"+field.getDeclaringClass().getSimpleName()+"'";
      String child = "'"+field.getType().getSimpleName()+"'";
      String fieldName = "'"+field.getType().getSimpleName()+" "+field.getName()+"'";
      throw new ChildWithNoPkException("The entity you are saving of type="+owner+" has a field="+fieldName
          +" that does not yet have a primary key so you cannot save it.  To correct this\n" +
          "problem, you can either\n"
          +"1. SAVE the "+child+" BEFORE you save the "+owner+" OR\n"
          +"2. Call entityManager.fillInWithKey(Object entity), then SAVE your "+owner+"', then save your "+child+" NOTE that this" +
              "\nmethod #2 is used for when you have a bi-directional relationship where each is a child of the other");
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.exc.ChildWithNoPkException

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.