Перенос.
This commit is contained in:
27
src/GlobalData/Grid/Grid.java
Normal file
27
src/GlobalData/Grid/Grid.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package GlobalData.Grid;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class Grid extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE") //имя таблицы
|
||||
public Current name = Current.Undefined;
|
||||
@Description("DEFAULT ''")
|
||||
public String sizes = ""; //ширины столбцов запакованные через |. вводить объекты ради них нецелесообразно.
|
||||
public Grid() {
|
||||
}
|
||||
public Grid(Current name_in) {
|
||||
name = name_in;
|
||||
sizes = "";
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return name;
|
||||
}
|
||||
public Vector<Integer> unpack() {
|
||||
return Arrays.stream(sizes.split("\\|")).map(Integer::parseInt).collect(Collectors.toCollection(Vector::new));
|
||||
}
|
||||
}
|
||||
8
src/GlobalData/Grid/GridsDBTable.java
Normal file
8
src/GlobalData/Grid/GridsDBTable.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package GlobalData.Grid;
|
||||
import Common.Current;
|
||||
import Common.Database.DBTable;
|
||||
public class GridsDBTable extends DBTable<Current, Grid> {
|
||||
public GridsDBTable() {
|
||||
super(Current.class, Grid.class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user