Package org.hibernate

Examples of org.hibernate.HibernateException


    this.resultTransformer = transformer;
    return this;
  }

  public int executeUpdate() throws HibernateException {
    throw new HibernateException( "Not supported operation" );
  }
View Full Code Here


          className, DirectoryProviderFactory.class
      );
      provider = directoryClass.newInstance();
    }
    catch (Exception e) {
      throw new HibernateException( "Unable to instanciate directory provider: " + className, e );
    }
    try {
      provider.initialize( directoryProviderName, indexProps, searchFactoryImplementor );
    }
    catch (Exception e) {
      throw new HibernateException( "Unable to initialize: " + directoryProviderName, e);
    }
    int index = providers.indexOf( provider );
    if ( index != -1 ) {
      //share the same Directory provider for the same underlying store
      return providers.get( index );
View Full Code Here

    //there is nobody out there with a non default @Indexed.index
    if ( rootIndex != null ) {
      return rootIndex.getName();
    }
    else {
      throw new HibernateException(
          "Trying to extract the index name from a non @Indexed class: " + clazz.getName() );
    }
  }
View Full Code Here

    public void remove() {
      // TODO the alternative (default) version with list allows remove(),
      // but this will
      // only remove it from the list, not from db, so maybe we should
      // just ignore instead of throwing an exception
      throw new HibernateException("Unsupported operation: You cannot remove records this way.");
    }
View Full Code Here

            ctx = new InitialContext();
            Util.bind( ctx, sessionFactoryName, sessionFactory );
         }
         catch ( NamingException e )
         {
            throw new HibernateException( "Unable to bind SessionFactory into JNDI", e );
         }
         finally
         {
            if ( ctx != null )
            {
View Full Code Here

            ctx = new InitialContext();
            Util.unbind( ctx, sessionFactoryName );
         }
         catch ( NamingException e )
         {
            throw new HibernateException( "Unable to unbind SessionFactory from JNDI", e );
         }
         finally
         {
            if ( ctx != null )
            {
View Full Code Here

                } catch (Throwable e) {
                    e.printStackTrace();
                    // do nothing
                }
                if(throwException){
                    throw new HibernateException("JDBC connection object must be a oracle.jdbc.OracleConnection " +
                            "a " + WrappedConnection.class.getName() +
                            "a " + PoolableConnection.class.getName() +
                            "or a " + NewProxyConnection.class.getName() +
                            ". Connection class is " + connClassInCurrentClassLoader.getName());
                }
            }

            Method openMethod = getMethod(oracleBlobClass, ORACLE_OPEN_METHOD, Integer.TYPE, null, null);

            Field fieldReadWrite = oracleBlobClass.getField(ORACLE_MODE__READWRITE);
            arglist = new Object[1];
            arglist[0] = fieldReadWrite.get(null); //null is valid because of static field

            openMethod.invoke(tempBlob, arglist);

            Method getOutputStreamMethod = oracleBlobClass.getDeclaredMethod(ORACLE_GET_BINARY_OUTPUT_STREAM, null);

            OutputStream os = (OutputStream) getOutputStreamMethod.invoke(tempBlob, null);

            try {
                vw.writeValue(os, value);
                os.flush();
            } finally {
                os.close();
            }

            Method closeMethod = oracleBlobClass.getDeclaredMethod(ORACLE_CLOSE, null);

            closeMethod.invoke(tempBlob, null);

            statement.setBlob(index, (Blob) tempBlob);
        } catch (Exception e) {
            throw new HibernateException("Error in oracleNullSafeSet", e);
        }
    }
View Full Code Here

      case Types.CHAR:
      case Types.LONGVARCHAR:
      case Types.VARCHAR:
        return false;
      default:
        throw new HibernateException( "Unable to persist an Enum in a column of SQL Type: " + paramType );
    }
  }
View Full Code Here

    String enumClassName = parameters.getProperty( ENUM );
    try {
      enumClass = ReflectHelper.classForName( enumClassName, this.getClass() ).asSubclass( Enum.class );
    }
    catch (ClassNotFoundException exception) {
      throw new HibernateException( "Enum class not found", exception );
    }
    // is might be good to call it here, to see a possible error immediately
    // initEnumValue();
   
    //nullify unnullified properties yuck!
View Full Code Here

      try {
        Method method = enumClass.getDeclaredMethod( "values" );
        enumValues = (Object[]) method.invoke( null );
      }
      catch (Exception e) {
        throw new HibernateException( "Error while accessing enum.values(): " + enumClass, e );
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.HibernateException

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.