Examples of HibernateException


Examples of org.hibernate.HibernateException

      }
      for (Class clazz : involvedClasses) {
        DocumentBuilder builder = builders.get( clazz );
        //TODO should we rather choose a polymorphic path and allow non mapped entities
        if ( builder == null )
          throw new HibernateException( "Not a mapped entity (don't forget to add @Indexed): " + clazz );

//        final DirectoryProvider[] directoryProviders =
//            builder.getDirectoryProviderSelectionStrategy().getDirectoryProvidersForAllShards();
       
        //changed by jerry
View Full Code Here

Examples of org.hibernate.HibernateException

        try {
          hits = getHits( searcher );
          resultSize = hits.length();
        }
        catch (IOException e) {
          throw new HibernateException( "Unable to query Lucene index", e );
        }
        finally {
          //searcher cannot be null
          try {
            searchFactoryImplementor.getReaderProvider().closeReader( searcher.getIndexReader() );
View Full Code Here

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

Examples of org.hibernate.HibernateException

          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

Examples of org.hibernate.HibernateException

    //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

Examples of org.hibernate.HibernateException

    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

Examples of org.hibernate.HibernateException

            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

Examples of org.hibernate.HibernateException

            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

Examples of org.hibernate.HibernateException

                } 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

Examples of org.hibernate.HibernateException

      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
TOP
Copyright © 2018 www.massapi.com. 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.