Menu

[r16]: / trunk / src / MyPKColumn.java  Maximize  Restore  History

Download this file

50 lines (37 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
public class MyPKColumn extends MyColumn {
/**
* First Constructor for the class MyPrimaryKeyColumn,
* using this constructor isAutoIncrement() must return true
*/
public MyPKColumn() {
super("int", null);
this.setAutoIncrement(true);
}
/**
* First Constructor for the class MyPrimaryKeyColumn,
* using this constructor isAutoIncrement() must return true
* @param autoIncrement determines if this column will appears in the insertions
*/
public MyPKColumn(Boolean autoIncrement) {
super("int", null);
this.setAutoIncrement(autoIncrement);
}
/**
* Second Constructor for the class MyPrimaryKeyColumn,
* using this constructor isAutoIncrement() must return false
* @param type String representing the type of this column
* @param size Integer representing the size in bytes of this column
*/
public MyPKColumn(String type, Integer size) {
super(type, size);
this.setAutoIncrement(false);
}
/**
* @param args
*/
public static void main(String[] args) {
MyColumn teste = new MyPKColumn();
System.out.println(teste.getType());
System.out.println(teste.getSize());
}
}