Package com.draagon.meta

Examples of com.draagon.meta.MetaException


    private MetaObject getMetaObject( Object o )
        throws MetaException
    {
        if ( o == null )
            throw new MetaException( "Null value found, MetaObject expected" );

        if (! ( o instanceof MetaObject ))
            throw new MetaException( "MetaObject expected, not [" + o.getClass().getName() + "]" );

        return (MetaObject) o;
    }
View Full Code Here


    private MetaObject.Value getAttributeValue( MetaField f, Object obj )
        throws MetaException
    {
        if (! ( obj instanceof MetaObject ))
            throw new MetaException( "MetaObject expected, not [" + obj.getClass().getName() + "]" );

        return ((MetaObject) obj ).getObjectAttributeValue( f.getName() );
    }
View Full Code Here

  private void verifyMapping(Connection c, MetaClass mc, DatabaseDriver dd, ObjectMapping mapping) {
   
    if ( mapping == null ) return;

    if (!( mapping instanceof ObjectMappingDB )) {
      throw new MetaException( "Expected an ObjectMappingDB instance, not a [" + mapping.getClass().getSimpleName() + "]" );
    }
       
    ObjectMappingDB omdb = (ObjectMappingDB) mapping;
   
    try {
        if ( validateDefinition( c, dd, omdb.getDBDef() )) {
          createdDefs.add( omdb.getDBDef() );
        }
    }
    catch( Exception e ) {
      throw new MetaException( "Error validating mapping [" + mapping + "] for MetaClass [" + mc + "]: " + e.getMessage(), e );
    }
  }
View Full Code Here

      // Create the identity columns
      if ( col.isAutoIncrementor() )
      {
        if ( hasIdentity )
          throw new MetaException( "Table [" + table + "] cannot have multiple identity (auto id) columns!" );

        query += "NOT NULL IDENTITY( " + col.getSequence().getStart() + ", " + col.getSequence().getIncrement() + " ) ";

        hasIdentity = true;
      }
View Full Code Here

   */
  @Override
  protected String getNextAutoId( Connection conn, ColumnDef col ) throws SQLException
  {
    if ( col.getSequence() == null )
      throw new MetaException( "Column definition [" + col + "] has no sequence defined" );

    String seq = getProperName( col.getSequence().getNameDef() );

    try
    {
View Full Code Here

            throws MetaException {
        try {
            mConn.setReadOnly(state);
        }
        catch (Exception e) {
            throw new MetaException("Could not set JDBC Connection to read-only", e);
        }
    }
View Full Code Here

            throws MetaException {
        try {
            return mConn.isReadOnly();
        }
        catch (Exception e) {
            throw new MetaException("Could not determine if JDBC was read-only", e);
        }
    }
View Full Code Here

            throws MetaException {
        try {
            mConn.setAutoCommit(state);
        }
        catch (Exception e) {
            throw new MetaException("Could not set JDBC connection to auto commit", e);
        }
    }
View Full Code Here

            throws MetaException {
        try {
            return mConn.getAutoCommit();
        }
        catch (Exception e) {
            throw new MetaException("Could not get JDBC auto commit status", e);
        }
    }
View Full Code Here

            throws MetaException {
        try {
            mConn.commit();
        }
        catch (Exception e) {
            throw new MetaException("Could not commit on JDBC connection", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.draagon.meta.MetaException

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.