org.eclipse.datatools.sqltools.core
Class ProcIdentifierImpl

java.lang.Object
  extended byorg.eclipse.datatools.sqltools.core.ProcIdentifierImpl
All Implemented Interfaces:
ProcIdentifier

public class ProcIdentifierImpl
extends java.lang.Object
implements ProcIdentifier

This interface is used to uniquely identifies a stored procedure, or trigger, or event handler, etc. Different database type may use different way to identify that, such as an ID. Client application should not directly create an ProcIdentifierImpl, should create it through the corresponding factory.

Author:
Yang Liu

Field Summary
 
Fields inherited from interface org.eclipse.datatools.sqltools.core.ProcIdentifier
PROP_DBNAME, PROP_NAME, PROP_NUMBER, PROP_OWNER, PROP_PROFILE, PROP_TABLENAME, PROP_TABLEOWNERNAME, PROP_TYPE, TYPE_EVENT, TYPE_SP, TYPE_SQL, TYPE_TRIGGER, TYPE_UDF
 
Constructor Summary
ProcIdentifierImpl(int type, DatabaseIdentifier db, java.util.Map map)
           
 
Method Summary
static ProcIdentifier decode(java.lang.String encoded)
           
static java.util.Map decodeMap(java.lang.String encoded)
           
static ProcIdentifier decodeWithNewProfile(java.lang.String encoded, java.lang.String profile)
           
 java.lang.String encode()
          Encoded this as a string.
static void encodeMap(java.lang.StringBuffer buffer, java.util.Map map)
          assumes that keys don't contain '=' and '/', and values don't contain '/'
 boolean equals(java.lang.Object obj)
           
 boolean equalsByServer(java.lang.Object obj)
          Returns whether the given object equals to this ProcIdentifier object.
 java.lang.String getCallableString()
          Gets a executable SQL string for the rountine object.
 java.lang.String getCallableString(boolean quoted_id)
          Gets a executable SQL string for the rountine object.
 java.lang.String getCallableStringWithoutGroupNumber()
          Gets a executable SQL string for the rountine object without group number.
 java.lang.String getCallableStringWithoutGroupNumber(boolean quoted_id)
          Gets a executable SQL string for the rountine object without group number.
 DatabaseIdentifier getDatabaseIdentifier()
           
 java.lang.String getDatabaseName()
           
 java.lang.String getDisplayString()
          Gets a short display string for the rountine object.
 java.lang.String getLongDisplayString()
          Gets a long display string for the rountine object.
 int getNumber()
          This method is only valid when this stored procedure supports group.
 java.lang.String getOwnerName()
          get owner name of the database object.
 java.lang.String getProcName()
          get the procedure or trigger or event handler's name
 java.lang.String getProfileName()
           
 java.lang.String getTableName()
          This is method is only valid when this proc is trigger.
 java.lang.String getTableOwnerName()
          Gets owner name of the subject table when the procedural object type is trigger .
 int getType()
          Gets the database object's type, as defined in this interface.
 int hashCode()
           
 void setProfileName(java.lang.String profileName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcIdentifierImpl

public ProcIdentifierImpl(int type,
                          DatabaseIdentifier db,
                          java.util.Map map)
Parameters:
type -
db -
map -
Method Detail

getType

public int getType()
Description copied from interface: ProcIdentifier
Gets the database object's type, as defined in this interface.

Specified by:
getType in interface ProcIdentifier

getProcName

public java.lang.String getProcName()
get the procedure or trigger or event handler's name

Specified by:
getProcName in interface ProcIdentifier
Returns:

getOwnerName

public java.lang.String getOwnerName()
get owner name of the database object.

Specified by:
getOwnerName in interface ProcIdentifier
Returns:

getDatabaseIdentifier

public DatabaseIdentifier getDatabaseIdentifier()
Specified by:
getDatabaseIdentifier in interface ProcIdentifier
Returns:
the database identifier

getDatabaseName

public java.lang.String getDatabaseName()
Specified by:
getDatabaseName in interface ProcIdentifier
Returns:
the database name

getProfileName

public java.lang.String getProfileName()
Specified by:
getProfileName in interface ProcIdentifier
Returns:
the connection profile name

getNumber

public int getNumber()
Description copied from interface: ProcIdentifier
This method is only valid when this stored procedure supports group. Otherwise will return 0

Specified by:
getNumber in interface ProcIdentifier

getTableName

public java.lang.String getTableName()
Description copied from interface: ProcIdentifier
This is method is only valid when this proc is trigger.

Specified by:
getTableName in interface ProcIdentifier

getTableOwnerName

public java.lang.String getTableOwnerName()
Description copied from interface: ProcIdentifier
Gets owner name of the subject table when the procedural object type is trigger .

Specified by:
getTableOwnerName in interface ProcIdentifier
Returns:
null if the procedural object type is not trigger. otherwise, it may equals to getOwnerName().

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

equalsByServer

public boolean equalsByServer(java.lang.Object obj)
Returns whether the given object equals to this ProcIdentifier object. If the profile names are different, the comparison will base on the server url.

Specified by:
equalsByServer in interface ProcIdentifier
Parameters:
obj -
Returns:

toString

public java.lang.String toString()

encodeMap

public static void encodeMap(java.lang.StringBuffer buffer,
                             java.util.Map map)
assumes that keys don't contain '=' and '/', and values don't contain '/'

Parameters:
buffer -
map -

decodeMap

public static java.util.Map decodeMap(java.lang.String encoded)

encode

public java.lang.String encode()
Description copied from interface: ProcIdentifier
Encoded this as a string. Can be decoded using ProcIdentifierImpl.decode()

Specified by:
encode in interface ProcIdentifier

decode

public static ProcIdentifier decode(java.lang.String encoded)
                             throws java.text.ParseException
Throws:
java.text.ParseException

decodeWithNewProfile

public static ProcIdentifier decodeWithNewProfile(java.lang.String encoded,
                                                  java.lang.String profile)
                                           throws java.text.ParseException
Throws:
java.text.ParseException

getDisplayString

public java.lang.String getDisplayString()
Description copied from interface: ProcIdentifier
Gets a short display string for the rountine object.

Specified by:
getDisplayString in interface ProcIdentifier

getLongDisplayString

public java.lang.String getLongDisplayString()
Description copied from interface: ProcIdentifier
Gets a long display string for the rountine object.

Specified by:
getLongDisplayString in interface ProcIdentifier

getCallableStringWithoutGroupNumber

public java.lang.String getCallableStringWithoutGroupNumber()
Description copied from interface: ProcIdentifier
Gets a executable SQL string for the rountine object without group number.

Specified by:
getCallableStringWithoutGroupNumber in interface ProcIdentifier

getCallableString

public java.lang.String getCallableString()
Description copied from interface: ProcIdentifier
Gets a executable SQL string for the rountine object.

Specified by:
getCallableString in interface ProcIdentifier
Returns:

setProfileName

public void setProfileName(java.lang.String profileName)

getCallableString

public java.lang.String getCallableString(boolean quoted_id)
Description copied from interface: ProcIdentifier
Gets a executable SQL string for the rountine object.

Specified by:
getCallableString in interface ProcIdentifier
Parameters:
quoted_id - whether "quoted identifier" is on

getCallableStringWithoutGroupNumber

public java.lang.String getCallableStringWithoutGroupNumber(boolean quoted_id)
Description copied from interface: ProcIdentifier
Gets a executable SQL string for the rountine object without group number.

Specified by:
getCallableStringWithoutGroupNumber in interface ProcIdentifier
Parameters:
quoted_id - whether "quoted identifier" is on


Copyright © 2007 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.