## org.eclipse.datatools.sqltools.sqleditor.internal.sql
Class SQLDBProposal

    java.lang.Object
      org.eclipse.datatools.sqltools.sqleditor.internal.sql.SQLDBProposal

Direct Known Subclasses:
  SQLBuilderDBProposal

    public class SQLDBProposal

extends java.lang.Object

Content assist proposal that represents either a catalog, schema, table, column, function, stored procedure, trigger, or event.

Author:
  Hetty Dougherty

Field Summary
`static int` `CATALOG_OBJTYPE`
`static int` `EVENT_OBJTYPE`
`static int` `FUNCTION_OBJTYPE`
`static int` `INDEX_OBJTYPE`
`static int` `SCHEMA_OBJTYPE`
`static int` `SEGMENT_OBJTYPE`
`static int` `STORED_PROCEDURE_OBJTYPE`
`static int` `TABLE_OBJTYPE`
`static int` `TABLEALIAS_OBJTYPE`
`static int` `TABLECOLUMN_OBJTYPE`
`static int` `TRIGGER_OBJTYPE`
`static int` `UNKNOWN_OBJTYPE`

Constructor Summary
`SQLDBProposal(org.eclipse.emf.ecore.EObject dbObject)` Constructs an instance of this object to represent the given database model object for purpose of a content assist proposal.
`SQLDBProposal(org.eclipse.emf.ecore.EObject dbObject, java.lang.String alias)` Constructs an instance of this object to represent the given database model object for purpose of a content assist proposal.
`SQLDBProposal(java.lang.String alias)` Constructs an instance of this object to represent the given table alias for purpose of a content assist proposal.

Method Summary
`org.eclipse.emf.ecore.EObject` `getDBObject()` Gets the database model object that this proposal represents.
`java.lang.String` `getGrandGrandParentName()` Gets the name of the grandgrandparent of the database model object associated with this proposal.
`java.lang.String` `getGrandParentName()` Gets the name of the grandparent of the database model object associated with this proposal.
`org.eclipse.swt.graphics.Image` `getImage()` Gets the image to be used for this content assist proposal.
`java.lang.String` `getName()` Gets the name of the database object.
`java.lang.String` `getParentAlias()` Gets the alias of the database object.
`java.lang.String` `getParentName()` Gets the name of the parent of the database model object associated with this proposal.
`org.eclipse.emf.ecore.EObject` `getParentObject()` Gets the parent of the database object.
`int` `getType()` Gets the type of the proposal.
`void` `setImage(org.eclipse.swt.graphics.Image image)` Sets the image to be used for this content assist proposal.
`void` `setName(java.lang.String name)` Sets the name to the given name.
`void` `setParentName(java.lang.String parentName)` Sets the parent name to the given name.
`void` `setType(int type)` Sets the type for this content assist proposal.
`java.lang.String` `toString()` Gets a string describing this object.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### SCHEMA_OBJTYPE

    public static final int SCHEMA_OBJTYPE

See Also:
  Constant Field Values

### TABLE_OBJTYPE

    public static final int TABLE_OBJTYPE

See Also:
  Constant Field Values

### TABLECOLUMN_OBJTYPE

    public static final int TABLECOLUMN_OBJTYPE

See Also:
  Constant Field Values

### CATALOG_OBJTYPE

    public static final int CATALOG_OBJTYPE

See Also:
  Constant Field Values

### FUNCTION_OBJTYPE

    public static final int FUNCTION_OBJTYPE

See Also:
  Constant Field Values

### STORED_PROCEDURE_OBJTYPE

    public static final int STORED_PROCEDURE_OBJTYPE

See Also:
  Constant Field Values

### TRIGGER_OBJTYPE

    public static final int TRIGGER_OBJTYPE

See Also:
  Constant Field Values

### EVENT_OBJTYPE

    public static final int EVENT_OBJTYPE

See Also:
  Constant Field Values

### TABLEALIAS_OBJTYPE

    public static final int TABLEALIAS_OBJTYPE

See Also:
  Constant Field Values

### INDEX_OBJTYPE

    public static final int INDEX_OBJTYPE

See Also:
  Constant Field Values

### SEGMENT_OBJTYPE

    public static final int SEGMENT_OBJTYPE

See Also:
  Constant Field Values

### UNKNOWN_OBJTYPE

    public static final int UNKNOWN_OBJTYPE

See Also:
  Constant Field Values

Constructor Detail

### SQLDBProposal

    public SQLDBProposal(org.eclipse.emf.ecore.EObject dbObject,
                         java.lang.String alias)

  Constructs an instance of this object to represent the given database model object for purpose of a content assist proposal. The database object can be one of `Schema`, `Table`, `Column`.

  Parameters:
    `dbObject` - the database model object
  See Also:
    `Schema`, `org.eclipse.datatools.modelbase.sql.schema.Table`, `org.eclipse.datatools.modelbase.sql.schema.Column`

### SQLDBProposal

    public SQLDBProposal(java.lang.String alias)

  Constructs an instance of this object to represent the given table alias for purpose of a content assist proposal.

  Parameters:
    `alias` - the table alias

### SQLDBProposal

    public SQLDBProposal(org.eclipse.emf.ecore.EObject dbObject)

  Constructs an instance of this object to represent the given database model object for purpose of a content assist proposal. The database object can be one of `Schema`, `Table`, `Column`.

  Parameters:
    `dbObject` - the database model object
  See Also:
    `Schema`, `org.eclipse.datatools.modelbase.sql.schema.Table`, `org.eclipse.datatools.modelbase.sql.schema.Column`

Method Detail

### getDBObject

    public org.eclipse.emf.ecore.EObject getDBObject()

  Gets the database model object that this proposal represents.

  Returns:
    the database model object

### getImage

    public org.eclipse.swt.graphics.Image getImage()

  Gets the image to be used for this content assist proposal.

  Returns:
    the image for this model object type

### getName

    public java.lang.String getName()

  Gets the name of the database object.

  Returns:
    the name of the database object

### getParentAlias

    public java.lang.String getParentAlias()

  Gets the alias of the database object.

  Returns:
    the alias of the database object, if none, equals to getParentName()

### getParentName

    public java.lang.String getParentName()

  Gets the name of the parent of the database model object associated with this proposal.

  Returns:
    the parent name

### getGrandParentName

    public java.lang.String getGrandParentName()

  Gets the name of the grandparent of the database model object associated with this proposal.

  Returns:
    the grand parent name

### getGrandGrandParentName

    public java.lang.String getGrandGrandParentName()

  Gets the name of the grandgrandparent of the database model object associated with this proposal.

  Returns:
    the grand parent name

### getParentObject

    public org.eclipse.emf.ecore.EObject getParentObject()

  Gets the parent of the database object.

  Returns:
    the parent of the database object

### getType

    public int getType()

  Gets the type of the proposal.

  Returns:
    type of proposal, which is one of
    1. SCHEMA_OBJTYPE
    2. TABLE_OBJTYPE
    3. TABLECOLUMN_OBJTYPE <eol>

### setImage

    public void setImage(org.eclipse.swt.graphics.Image image)

  Sets the image to be used for this content assist proposal.

  Parameters:
    `image` - the `Image` to use for this proposal

### setParentName

    public void setParentName(java.lang.String parentName)

  Sets the parent name to the given name.

  Parameters:
    `parentName` - the parent name to set

### setType

    public void setType(int type)

  Sets the type for this content assist proposal.

  Parameters:
    `type` - the type to set

### setName

    public void setName(java.lang.String name)

  Sets the name to the given name.

  Parameters:
    `name` - the name to set

### toString

    public java.lang.String toString()

  Gets a string describing this object. The name attribute of this object is returned.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    the string describing this object.