com.onewebsql.query.adapter
Class MySQLDBAdapter

java.lang.Object
  extended by com.onewebsql.query.adapter.BaseDBAdapter
      extended by com.onewebsql.query.adapter.MySQLDBAdapter
All Implemented Interfaces:
DBAdapter

public class MySQLDBAdapter
extends BaseDBAdapter

Implementation of DBAdapter interface for the MySQL database.


Field Summary
 
Fields inherited from class com.onewebsql.query.adapter.BaseDBAdapter
DEFAULT_VALUE_LIST_PARAMETER_HANDLER, LOB_BURST_SIZE, NEXT_VALUE_FOR, SEQUENCE_ROW_HANDLER
 
Constructor Summary
MySQLDBAdapter()
          Create a new MySQLDBAdapter object.
 
Method Summary
 Long getNextId(String sequenceName, String schemaName, DataSource ds)
          Returns the next value from the sequence with the specified name and the specified schema name, from the specified data source.
 boolean join(Join join, String schemaName, StringBuilder sb, List<Value> objs)
          Builds a join query in a way specific for MySQL database.
 
Methods inherited from class com.onewebsql.query.adapter.BaseDBAdapter
buildIdWhere, buildQuery, getBlob, getClob, getValueListParameterHandler, setBlob, setClob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLDBAdapter

public MySQLDBAdapter()
Create a new MySQLDBAdapter object.

Method Detail

join

public boolean join(Join join,
                    String schemaName,
                    StringBuilder sb,
                    List<Value> objs)
Builds a join query in a way specific for MySQL database. The difference is that the JOIN query in MySQL are called INNER JOIN. It always returns true.

Specified by:
join in interface DBAdapter
Overrides:
join in class BaseDBAdapter
Parameters:
join - join query
schemaName - schema name used to build the query
sb - StringBuilder where we build the query
objs - an accumulator list to which join parameters are added
Returns:
true

getNextId

public Long getNextId(String sequenceName,
                      String schemaName,
                      DataSource ds)
Returns the next value from the sequence with the specified name and the specified schema name, from the specified data source. The method uses the table tech_max_id to generate unique identifiers. The table should be created by SQL script creating database structure.

Specified by:
getNextId in interface DBAdapter
Overrides:
getNextId in class BaseDBAdapter
Parameters:
sequenceName - sequence name
schemaName - name of the schema
ds - data source
Returns:
next value of the sequence


Copyright © 2011-2013 e-point SA. All Rights Reserved.