Compiere 3.1

org.compiere.db
Class CConstraint

java.lang.Object
  extended by org.compiere.db.CConstraint

public class CConstraint
extends Object

Processing additional tasks for constraints

Author:
Jinglun Zhang

Constructor Summary
protected CConstraint()
          Constructor.
 
Method Summary
static String forTrigger(int reExNo, String msg, String sql)
           
static String get(Connection conn, String cname)
          get constriant name from original name
static String[] getConstrainNames(Connection conn, String table)
          get constriant names of the table
static String getConstraintName(Connection conn, String oriName)
          get constriant information
static int save(Connection conn, String sql, String oriName)
          save constriant information for later to use CREATE TABLE "COMPIERE"."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CConstraint

protected CConstraint()
Constructor.

Method Detail

save

public static int save(Connection conn,
                       String sql,
                       String oriName)
save constriant information for later to use CREATE TABLE "COMPIERE"."AD_FOREIGNKEYINFO" ( "CONSTRAINTNAME" VARCHAR(126) NOT NULL , "TABLENAME" VARCHAR(62) NOT NULL , "P_TABLENAME" VARCHAR(62) , "C_TYPE" CHAR(1) NOT NULL WITH DEFAULT 'F' , "C_STATEMENT" VARCHAR(2000) , "ORIGINALNAME" VARCHAR(128) ) IN "USERSPACE1" ; COMMENT ON COLUMN "COMPIERE"."AD_FOREIGNKEYINFO"."C_TYPE" IS 'F: FK, P:PK, T:Trigger';

Parameters:
conn - Connection
sql - constraint sql
oriName - Original constraint name, usually longer than 18 chars
Returns:
-1: fail

getConstraintName

public static String getConstraintName(Connection conn,
                                       String oriName)
get constriant information

Parameters:
conn - Connection
oriName - Original constraint name, usually longer than 18 chars
Returns:
constraint name

get

public static String get(Connection conn,
                         String cname)
get constriant name from original name

Parameters:
conn - Connection
cname - constraint name
Returns:
sql constraint sql

getConstrainNames

public static String[] getConstrainNames(Connection conn,
                                         String table)
get constriant names of the table

Parameters:
conn - Connection
table - table name
Returns:
sql constraint names

forTrigger

public static String forTrigger(int reExNo,
                                String msg,
                                String sql)

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.