public static void tagNode(final SQLProvider provider,final INaviViewNode node,final int tagId) throws CouldntSaveDataException {
  Preconditions.checkNotNull(provider,"IE01309: provider argument can not be null");
  Preconditions.checkNotNull(node,"IE01663: node argument can not be null");
  final CConnection connection=provider.getConnection();
  untagNode(provider,node,tagId);
  final String tagQuery=String.format("INSERT INTO %s " + "(node_id, tag_id) " + "VALUES (%d, %d)",CTableNames.TAGGED_NODES_TABLE,node.getId(),tagId);
  try {
    connection.executeUpdate(tagQuery,true);
  }
 catch (  final SQLException exception) {
    throw new CouldntSaveDataException(exception);
  }
}

public static void tagNode ( final SQLProvider provider , final INaviViewNode node , final int tagId ) throws CouldntSaveDataException { Preconditions . checkNotNull ( provider , "IE01309: provider argument can not be null" ) ; Preconditions . checkNotNull ( node , "IE01663: node argument can not be null" ) ; final CConnection connection = provider . getConnection ( ) ; untagNode ( provider , node , tagId ) ; final String tagQuery = String . format ( "INSERT INTO %s " + "(node_id, tag_id) " + "VALUES (%d, %d)" , CTableNames . TAGGED_NODES_TABLE , node . getId ( ) , tagId ) ; try { connection . executeUpdate ( tagQuery , true ) ; } catch ( final SQLException exception ) { throw new CouldntSaveDataException ( exception ) ; } }
tags a node with a given tag . the node must be stored in the database connected to by the provider argument .
