protected static long insert(final Instance _instance,
                                 final ConnectionResource _con)
        throws EFapsException
    {
        long ret = 0;
        if (_instance.isValid() && _instance.getType().isGeneralInstance()) {
            try {
                final SQLInsert insert = Context.getDbType().newInsert(GeneralInstance.TABLENAME,
                                GeneralInstance.IDCOLUMN,
                                true);
                insert.column(GeneralInstance.ISTYPECOLUMN, _instance.getType().getId());
                insert.column(GeneralInstance.ISIDCOLUMN, _instance.getId());
                insert.column(GeneralInstance.EXIDCOLUMN, _instance.getExchangeId(false));
                insert.column(GeneralInstance.EXSYSIDCOLUMN, _instance.getExchangeSystemId(false));
                ret = insert.execute(_con);
                _instance.setGeneralId(ret);
                _instance.setGeneralised(true);
            } catch (final SQLException e) {
                GeneralInstance.LOG.error("executeOneStatement", e);
                throw new EFapsException(GeneralInstance.class, "create", e);
            }
        }
        return ret;
    }
protected static long insert ( final Instance _instance , final ConnectionResource _con ) throws EFapsException { long ret = 0 ; if ( _instance . isValid ( ) && _instance . getType ( ) . isGeneralInstance ( ) ) { try { final SQLInsert insert = Context . getDbType ( ) . newInsert ( GeneralInstance . TABLENAME , GeneralInstance . IDCOLUMN , true ) ; insert . column ( GeneralInstance . ISTYPECOLUMN , _instance . getType ( ) . getId ( ) ) ; insert . column ( GeneralInstance . ISIDCOLUMN , _instance . getId ( ) ) ; insert . column ( GeneralInstance . EXIDCOLUMN , _instance . getExchangeId ( false ) ) ; insert . column ( GeneralInstance . EXSYSIDCOLUMN , _instance . getExchangeSystemId ( false ) ) ; ret = insert . execute ( _con ) ; _instance . setGeneralId ( ret ) ; _instance . setGeneralised ( true ) ; } catch ( final SQLException e ) { GeneralInstance . LOG . error ( "executeOneStatement" , e ) ; throw new EFapsException ( GeneralInstance . class , "create" , e ) ; } } return ret ; }
@param _instance Instance the GeneralInstance will be created for.
@param _con      Connection the insert will be executed in
@return id of the new instance
@throws EFapsException on  error