1 package org.ashkelon; 2 7 8 import java.sql.Connection ; 9 import java.sql.SQLException ; 10 import java.util.HashMap ; 11 import java.util.Map ; 12 13 import org.ashkelon.db.DBUtils; 14 15 import com.sun.javadoc.ConstructorDoc; 16 17 24 public class ConstructorMember extends ExecMember 25 { 26 private static String TABLENAME = "CONSTRUCTOR"; 27 28 public ConstructorMember(String qualifiedName, String signature) 29 { 30 super(qualifiedName + qualifiedName.substring(qualifiedName.lastIndexOf(".")), signature, Member.CONSTRUCTOR_MEMBER); 31 } 32 33 public ConstructorMember(ConstructorDoc constructordoc, ClassType containingClass) 34 { 35 super(constructordoc, containingClass); 36 } 37 38 public ConstructorMember(Member member, String signature) 39 { 40 super(member, signature); 41 } 42 43 public void store(Connection conn) throws SQLException 44 { 45 super.store(conn); 46 Map fieldInfo = new HashMap (5); 47 fieldInfo.put("ID", new Integer (getId(conn))); 48 DBUtils.insert(conn, TABLENAME, fieldInfo); 49 } 50 51 public static void delete(Connection conn, int memberid, int docid) throws SQLException 52 { 53 Map constraint = new HashMap (); 54 constraint.put("ID", new Integer (memberid)); 55 DBUtils.delete(conn, TABLENAME, constraint); 56 57 ExecMember.delete(conn, memberid, docid); 58 } 59 60 public static String fixQualifiedName(String qualifiedName) 61 { 62 int idx = qualifiedName.lastIndexOf("."); 63 String lastPart = qualifiedName.substring(idx); 64 return qualifiedName + lastPart; 65 } 66 } 67 | Popular Tags |