AxionContextTestingFactory.java :  » Database-ORM » jaxor-3.5 » net » sourceforge » jaxor » example » db » Java Open Source

Java Open Source » Database ORM » jaxor 3.5 
jaxor 3.5 » net » sourceforge » jaxor » example » db » AxionContextTestingFactory.java
package net.sourceforge.jaxor.example.db;

import net.sourceforge.jaxor.util.SystemException;

import java.sql.Types;

/**
 * Created By:   Mike
 * Date:         Nov 28, 2003
 * Time:         4:36:32 PM
 *
 * Last Checkin: $Author: mrettig $
 * Date:         $Date: 2004/01/24 17:53:47 $
 * Revision:     $Revision: 1.2 $
 */
public class AxionContextTestingFactory extends JaxorContextTestingFactoryImpl {

    public AxionContextTestingFactory() {
        super(AxionConnection.INSTANCE.getConnection(), true);
    }

    public String getCreateTable(int type) {
        switch (type) {
            case Types.VARCHAR:
                return "STRING";
            case Types.BIGINT:
                return "LONG";
            case Types.TIMESTAMP:
                return "TIMESTAMP";
            case Types.NUMERIC:
                return "NUMBER";
            case Types.BIT:
                return "BOOLEAN";
            case Types.INTEGER:
                return "INTEGER";
            case Types.DATE:
                return "DATE";
            case Types.TINYINT:
                return "BYTE";
            case Types.SMALLINT:
                return "SHORT";
            case Types.REAL:
                return "FLOAT";
            case Types.DOUBLE:
                return "NUMBER";
            default:
                throw new SystemException("Unknown type: " + type);
        }
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.