Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  *  Copyright 2009-2014 Pavel Ponec
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.ujorm.orm;
A type service for popular Java types and more. Implementation must have got an no-parameter constructor.

Parameters:
<J> Java types iń the business objects
<D> Converted Java types to a JDBC type ready
Author(s):
Pavel Ponec
public interface ITypeService<J,D> {

    
GetValue from the result set by position It must be the same implementation as getValue(org.ujorm.orm.metaModel.MetaColumn,java.sql.CallableStatement,int).

Parameters:
mColumn Meta-model column, where the typeCode must be assigned before.
rs The ResultSet instance
c Catabase column index starting at #1
Returns:
Value form the result set.
Throws:
java.sql.SQLException
    public J getValue(final MetaColumn mColumnfinal ResultSet rsfinal int cthrows SQLException;

    
GetValue from the stored precedure by position. It must be the same implementation as getValue(org.ujorm.orm.metaModel.MetaColumn,java.sql.ResultSet,int).

Parameters:
mColumn Meta-model column, where the typeCode must be assigned before.
rs The CallableStatement instance
c Catabase column index starting at #1
Returns:
Value form the result set.
Throws:
java.sql.SQLException
    public J getValue(final MetaColumn mColumnfinal CallableStatement rsfinal int cthrows SQLException;

    
GetValue from the result set by position.

Parameters:
mColumn Meta-model column, where the typeCode must be assigned before.
rs PreparedStatement
value Value to assign
c The database column index starts at #1
Throws:
java.sql.SQLException
    public void setValue
        ( final MetaColumn mColumn
        , final PreparedStatement rs
        , final J value
        , final int c
        ) throws SQLException;


    
Return an converted Java type to use in database DDL statements.
    public Class<D> getDbTypeClass(final MetaColumn column);
New to GrepCode? Check out our FAQ X