working on stock refactoring
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -138,7 +138,7 @@ public class Constants {
|
||||
public static final String OFFSET = "offset";
|
||||
public static final String OPTIONAL = "optional";
|
||||
public static final String OWNER = "owner";
|
||||
public static final String OWNER_ID = "owner_id";
|
||||
public static final String OWNER_NUMBER = "owner_number";
|
||||
|
||||
public static final String PARENT_LOCATION_ID = "parent_location_id";
|
||||
public static final String PARENT_TASK_ID = "parent_task_id";
|
||||
|
||||
@@ -11,17 +11,17 @@ import java.util.*;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class Item implements Mappable {
|
||||
private long id, number; // id is the database key, number the owner-relative id
|
||||
private long id, ownerNumber; // id is the database key, number the owner-relative id
|
||||
private Owner owner;
|
||||
private String code, name;
|
||||
private Location location;
|
||||
private Collection<Property> properties;
|
||||
private Set<String> dirtyFields = new HashSet<>();
|
||||
|
||||
private Item(long id, Owner owner, long number, Location location, String code, String name) {
|
||||
private Item(long id, Owner owner, long ownerNumber, Location location, String code, String name) {
|
||||
this.id = id;
|
||||
this.owner = owner;
|
||||
this.number = number;
|
||||
this.ownerNumber = ownerNumber;
|
||||
this.location = location;
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
@@ -50,12 +50,12 @@ public class Item implements Mappable {
|
||||
|
||||
public static Item of(ResultSet rs) throws SQLException {
|
||||
var id = rs.getLong(ID);
|
||||
var owner = OwnerRef.of(rs);
|
||||
var ownerNumber = rs.getLong(OWNER_NUMBER);
|
||||
var location = Location.of(rs);
|
||||
var code = rs.getString(CODE);
|
||||
var name = rs.getString(NAME);
|
||||
var owner = OwnerRef.of(rs);
|
||||
var number = rs.getLong(NUMBER);
|
||||
var location = Location.of(rs);
|
||||
return new Item(id, owner, number, location, code, name);
|
||||
return new Item(id, owner, ownerNumber, location, code, name);
|
||||
}
|
||||
|
||||
public Owner owner(){
|
||||
|
||||
Reference in New Issue
Block a user