根据尚学堂录的教程做的。:

配置文件 db.properties

driver=com.mysql.jdbc.Driver
url=jdbc\:mysql\://127.0.0.1\:3306/sorm
user=root
password=123
usingDB=mysql
srcPath=/home/frank/MyEclipseWorkSpace/S_ORM/src
poPackage=com.frank.po
queryClass=com.frank.sorm.core.imp.MySqlQuery
poolMinSize=10
poolMaxSize=100

只支持mysql数据库.poPackage为框架根据数据库表自动生成的domain类的包名

com.frank.sorm.bean

  ColumnInfo.java

  

 1 package com.frank.sorm.bean;
 2 
 3 /**
 4  * 封装表中一个字段的信息
 5  * @author frank
 6  *
 7  */
 8 public class ColumnInfo {
 9     
10 
11     public static final int NORMAL_KEY=0;
12     public  static final int PRIMARY_KEY=1;
13     public  static final int FOREIGN_KEY=2;
14     
15     /**
16      *  字段名称
17      */
18     private String colName;
19     
20     /**
21      * 字段类型
22      */
23     private String dataType;
24     
25     /**
26      * 字段的键类型
27      * 0:普通键 1:主键 2:外键
28      */
29     private int keyType;
30 
31     public String getColName() {
32         return colName;
33     }
34 
35     public void setColName(String colName) {
36         this.colName = colName;
37     }
38 
39     public String getDataType() {
40         return dataType;
41     }
42 
43     public void setDataType(String dataType) {
44         this.dataType = dataType;
45     }
46 
47     public int getKeyType() {
48         return keyType;
49     }
50 
51     public void setKeyType(int keyType) {
52         this.keyType = keyType;
53     }
54 
55     public ColumnInfo(String colName, String dataType, int keyType) {
56         super();
57         this.colName = colName;
58         this.dataType = dataType;
59         this.keyType = keyType;
60     }
61     public ColumnInfo() {
62     }
63 
64 }
View Code

相关文章:

  • 2022-12-23
  • 2020-11-10
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-04-04
  • 2022-02-04
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-02-10
相关资源
相似解决方案