1 14 package org.compiere.model; 15 16 import java.util.*; 17 import java.sql.*; 18 19 import org.compiere.util.*; 20 21 27 public class MClientInfo extends X_AD_ClientInfo 28 { 29 35 public static MClientInfo get (Properties ctx, int AD_Client_ID) 36 { 37 MClientInfo retValue = null; 38 String sql = "SELECT * FROM AD_ClientInfo WHERE AD_Client_ID=?"; 39 PreparedStatement pstmt = null; 40 try 41 { 42 pstmt = DB.prepareStatement (sql); 43 pstmt.setInt (1, AD_Client_ID); 44 ResultSet rs = pstmt.executeQuery (); 45 if (rs.next ()) 46 retValue = new MClientInfo (ctx, rs); 47 rs.close (); 48 pstmt.close (); 49 pstmt = null; 50 } 51 catch (SQLException ex) 52 { 53 s_log.error ("get", ex); 54 } 55 try 56 { 57 if (pstmt != null) 58 pstmt.close (); 59 } 60 catch (SQLException ex1) 61 { 62 } 63 pstmt = null; 64 return retValue; 66 } 68 69 private static Logger s_log = Logger.getCLogger (MClientInfo.class); 70 71 76 public MClientInfo (Properties ctx, ResultSet rs) 77 { 78 super (ctx, rs); 79 } 81 private MAcctSchema m_acctSchema = null; 82 83 87 public MAcctSchema getMAcctSchema1() 88 { 89 if (m_acctSchema == null && getC_AcctSchema1_ID() != 0) 90 m_acctSchema = new MAcctSchema (getCtx(), getC_AcctSchema1_ID()); 91 return m_acctSchema; 92 } 94 98 public int getC_Currency_ID() 99 { 100 if (m_acctSchema == null) 101 getMAcctSchema1(); 102 if (m_acctSchema != null) 103 return m_acctSchema.getC_Currency_ID(); 104 return 0; 105 } 107 } | Popular Tags |