Package org.hibernate

Examples of org.hibernate.MappingException


            LOG.debugf("Session-factory config [%s] named class [%s] for mapping", name, className);
      try {
        addAnnotatedClass( ReflectHelper.classForName( className ) );
      }
      catch ( Exception e ) {
        throw new MappingException(
            "Unable to load class [ " + className + "] declared in Hibernate configuration <mapping/> entry",
            e
        );
      }
    }
    else {
      throw new MappingException( "<mapping> element in configuration specifies no known attributes" );
    }
  }
View Full Code Here


  RootClass getRootClassMapping(String clazz) throws MappingException {
    try {
      return (RootClass) getClassMapping( clazz );
    }
    catch (ClassCastException cce) {
      throw new MappingException( "You may only specify a cache for root <class> mappings" );
    }
  }
View Full Code Here

  }

  private void applyCacheConcurrencyStrategy(CacheHolder holder) {
    RootClass rootClass = getRootClassMapping( holder.role );
    if ( rootClass == null ) {
      throw new MappingException( "Cannot cache an unknown entity: " + holder.role );
    }
    rootClass.setCacheConcurrencyStrategy( holder.usage );
    rootClass.setCacheRegionName( holder.region );
    rootClass.setLazyPropertiesCacheable( holder.cacheLazy );
  }
View Full Code Here

  }

  private void applyCollectionCacheConcurrencyStrategy(CacheHolder holder) {
    Collection collection = getCollectionMapping( holder.role );
    if ( collection == null ) {
      throw new MappingException( "Cannot cache an unknown collection: " + holder.role );
    }
    collection.setCacheConcurrencyStrategy( holder.usage );
    collection.setCacheRegionName( holder.region );
  }
View Full Code Here

    private String getLogicalTableName(String schema, String catalog, String physicalName) throws MappingException {
      String key = buildTableNameKey( schema, catalog, physicalName );
      TableDescription descriptor = (TableDescription) tableNameBinding.get( key );
      if (descriptor == null) {
        throw new MappingException( "Unable to find physical table: " + physicalName);
      }
      return descriptor.logicalName;
    }
View Full Code Here

          currentTable = null;
        }
      } while ( finalName == null && currentTable != null );

      if ( finalName == null ) {
        throw new MappingException(
            "Unable to find column with logical name " + logicalName + " in table " + table.getName()
        );
      }
      return finalName;
    }
View Full Code Here

          currentTable = null;
        }
      }
      while ( logical == null && currentTable != null && description != null );
      if ( logical == null ) {
        throw new MappingException(
            "Unable to find logical column name from physical name "
                + physicalName + " in table " + table.getName()
        );
      }
      return logical;
View Full Code Here

   *
   * @return The appropriate select command
   * @throws MappingException If IDENTITY generation is not supported.
   */
  protected String getIdentitySelectString() throws MappingException {
    throw new MappingException( getClass().getName() + " does not support identity key generation" );
  }
View Full Code Here

   *
   * @return The appropriate DDL fragment.
   * @throws MappingException If IDENTITY generation is not supported.
   */
  protected String getIdentityColumnString() throws MappingException {
    throw new MappingException( getClass().getName() + " does not support identity key generation" );
  }
View Full Code Here

   * @param sequenceName the name of the sequence
   * @return String The "nextval" select string.
   * @throws MappingException If sequences are not supported.
   */
  public String getSequenceNextValString(String sequenceName) throws MappingException {
    throw new MappingException( getClass().getName() + " does not support sequences" );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.MappingException

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.