Class SybaseAdapter

    • Constructor Detail

      • SybaseAdapter

        public SybaseAdapter​(java.sql.DatabaseMetaData metadata)
        Constructor.
        Parameters:
        metadata - MetaData for the DB
    • Method Detail

      • getDropDatabaseStatement

        public java.lang.String getDropDatabaseStatement​(java.lang.String catalogName,
                                                         java.lang.String schemaName)
        Description copied from interface: DatastoreAdapter
        Method to return the statement necessary to drop a database with this RDBMS. Note that some RDBMS don't support this.
        Specified by:
        getDropDatabaseStatement in interface DatastoreAdapter
        Overrides:
        getDropDatabaseStatement in class BaseDatastoreAdapter
        Parameters:
        catalogName - Name of the catalog
        schemaName - Name of the schema
        Returns:
        The DDL statement
      • getDropTableStatement

        public java.lang.String getDropTableStatement​(Table table)
        Accessor for the DROP TABLE statement for Sybase. Sybase doesnt support CASCADE CONSTRAINTS so we just return a simple DROP TABLE table-name
        Specified by:
        getDropTableStatement in interface DatastoreAdapter
        Overrides:
        getDropTableStatement in class BaseDatastoreAdapter
        Parameters:
        table - The table to drop.
        Returns:
        The DROP TABLE statement
      • getUpdateTableStatement

        public SQLText getUpdateTableStatement​(SQLTable tbl,
                                               SQLText setSQL)
        Method to return the SQLText for an UPDATE TABLE statement. Returns the SQLText for UPDATE T1 SET x1 = val1, x2 = val2 FROM MYTBL T1. Override if the datastore doesn't support that standard syntax.
        Specified by:
        getUpdateTableStatement in interface DatastoreAdapter
        Overrides:
        getUpdateTableStatement in class BaseDatastoreAdapter
        Parameters:
        tbl - The primary table
        setSQL - The SQLText for the SET component
        Returns:
        SQLText for the update statement
      • newSQLTypeInfo

        public SQLTypeInfo newSQLTypeInfo​(java.sql.ResultSet rs)
        Description copied from interface: DatastoreAdapter
        Create a new SQL type info from the current row of the passed ResultSet. Allows an adapter to override particular types where the JDBC driver is known to be buggy.
        Specified by:
        newSQLTypeInfo in interface DatastoreAdapter
        Overrides:
        newSQLTypeInfo in class BaseDatastoreAdapter
        Parameters:
        rs - ResultSet
        Returns:
        The SQL type info
      • newRDBMSColumnInfo

        public RDBMSColumnInfo newRDBMSColumnInfo​(java.sql.ResultSet rs)
        Method to create a column info for the current row. Overrides the dataType/columnSize/decimalDigits to cater for Sybase particularities.
        Specified by:
        newRDBMSColumnInfo in interface DatastoreAdapter
        Overrides:
        newRDBMSColumnInfo in class BaseDatastoreAdapter
        Parameters:
        rs - ResultSet from DatabaseMetaData.getColumns()
        Returns:
        column info
      • getIdentityLastValueStmt

        public java.lang.String getIdentityLastValueStmt​(Table table,
                                                         java.lang.String columnName)
        Accessor for the auto-increment sql statement for this datastore.
        Specified by:
        getIdentityLastValueStmt in interface DatastoreAdapter
        Overrides:
        getIdentityLastValueStmt in class BaseDatastoreAdapter
        Parameters:
        table - Name of the table that the autoincrement is for
        columnName - Name of the column that the autoincrement is for
        Returns:
        The statement for getting the latest auto-increment key
      • getIdentityKeyword

        public java.lang.String getIdentityKeyword​(org.datanucleus.store.StoreManager storeMgr)
        Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...).
        Specified by:
        getIdentityKeyword in interface DatastoreAdapter
        Overrides:
        getIdentityKeyword in class BaseDatastoreAdapter
        Parameters:
        storeMgr - The Store Manager
        Returns:
        The keyword for a column using auto-increment
      • getSQLMethodClass

        public java.lang.Class<? extends SQLMethod> getSQLMethodClass​(java.lang.String className,
                                                                      java.lang.String methodName,
                                                                      org.datanucleus.ClassLoaderResolver clr)
        Description copied from interface: DatastoreAdapter
        Accessor for the SQLMethod class for the query invocation of specified class + method name (if available for this datastore).
        Specified by:
        getSQLMethodClass in interface DatastoreAdapter
        Overrides:
        getSQLMethodClass in class BaseDatastoreAdapter
        Parameters:
        className - Name of the class (or null if this is a STATIC method)
        methodName - Method name
        clr - ClassLoader resolver, in case className is a subclass of a supported type
        Returns:
        The SQLMethod class (or null if not defined for this datastore).
      • loadColumnMappings

        protected void loadColumnMappings​(org.datanucleus.plugin.PluginManager mgr,
                                          org.datanucleus.ClassLoaderResolver clr)
        Load all datastore mappings for this RDBMS database.
        Overrides:
        loadColumnMappings in class BaseDatastoreAdapter
        Parameters:
        mgr - the PluginManager
        clr - the ClassLoaderResolver