Code example for SQLiteConstraintException

Methods: getMessage

0
        { 
            database.executeUpdate("delete from behaviour where _id=?", new Object[] { id }); //$NON-NLS-1$
        } 
        catch (SQLiteConstraintException e)
        { 
            Log.e(Constants.PACKAGE, "Couldnot delete behaviour: " + e.getMessage()); //$NON-NLS-1$
            throw new BehaviourProbablyInUseException(); 
        } 
    } 
     
    public Behaviour getBehaviour(int id) 
    { 
        List<Behaviour> behaviours = getBehaviours("where _id=?", new Object[] { id }); //$NON-NLS-1$
        if ( behaviours != null && behaviours.size() > 0 )
        { 
            if ( behaviours.size() > 1 ) 
            { 
                Log.w(Constants.PACKAGE, "Too many themes retrieved (themeId=" + id + "). Returning the first one."); //$NON-NLS-1$ //$NON-NLS-2$
            } 
            return behaviours.get(0);