Skip to content

Commit

Permalink
Adjusted code generation for cursor-specific columns (issue #12).
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed May 3, 2012
1 parent ea658c7 commit 58d91aa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
32 changes: 16 additions & 16 deletions src/main/java/com/tightdb/generated/Employee.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
*/
public class Employee extends AbstractCursor<Employee> {

public final StringColumn<Employee, EmployeeQuery> firstName;
public final StringColumn<Employee, EmployeeQuery> lastName;
public final LongColumn<Employee, EmployeeQuery> salary;
public final BooleanColumn<Employee, EmployeeQuery> driver;
public final BinaryColumn<Employee, EmployeeQuery> photo;
public final DateColumn<Employee, EmployeeQuery> birthdate;
public final MixedColumn<Employee, EmployeeQuery> extra;
public final TableColumn<Employee, EmployeeQuery, PhoneTable> phones;
public final StringCursorColumn<Employee, EmployeeQuery> firstName;
public final StringCursorColumn<Employee, EmployeeQuery> lastName;
public final LongCursorColumn<Employee, EmployeeQuery> salary;
public final BooleanCursorColumn<Employee, EmployeeQuery> driver;
public final BinaryCursorColumn<Employee, EmployeeQuery> photo;
public final DateCursorColumn<Employee, EmployeeQuery> birthdate;
public final MixedCursorColumn<Employee, EmployeeQuery> extra;
public final TableCursorColumn<Employee, EmployeeQuery, PhoneTable> phones;

public Employee(TableBase table, long position) {
super(table, Employee.class, position);

firstName = new StringColumn<Employee, EmployeeQuery>(table, this, 0, "firstName");
lastName = new StringColumn<Employee, EmployeeQuery>(table, this, 1, "lastName");
salary = new LongColumn<Employee, EmployeeQuery>(table, this, 2, "salary");
driver = new BooleanColumn<Employee, EmployeeQuery>(table, this, 3, "driver");
photo = new BinaryColumn<Employee, EmployeeQuery>(table, this, 4, "photo");
birthdate = new DateColumn<Employee, EmployeeQuery>(table, this, 5, "birthdate");
extra = new MixedColumn<Employee, EmployeeQuery>(table, this, 6, "extra");
phones = new TableColumn<Employee, EmployeeQuery, PhoneTable>(table, this, 7, "phones", PhoneTable.class);
firstName = new StringCursorColumn<Employee, EmployeeQuery>(table, this, 0, "firstName");
lastName = new StringCursorColumn<Employee, EmployeeQuery>(table, this, 1, "lastName");
salary = new LongCursorColumn<Employee, EmployeeQuery>(table, this, 2, "salary");
driver = new BooleanCursorColumn<Employee, EmployeeQuery>(table, this, 3, "driver");
photo = new BinaryCursorColumn<Employee, EmployeeQuery>(table, this, 4, "photo");
birthdate = new DateCursorColumn<Employee, EmployeeQuery>(table, this, 5, "birthdate");
extra = new MixedCursorColumn<Employee, EmployeeQuery>(table, this, 6, "extra");
phones = new TableCursorColumn<Employee, EmployeeQuery, PhoneTable>(table, this, 7, "phones", PhoneTable.class);
}

public java.lang.String getFirstName() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/tightdb/generated/Phone.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
*/
public class Phone extends AbstractCursor<Phone> {

public final StringColumn<Phone, PhoneQuery> type;
public final StringColumn<Phone, PhoneQuery> number;
public final StringCursorColumn<Phone, PhoneQuery> type;
public final StringCursorColumn<Phone, PhoneQuery> number;

public Phone(TableBase table, long position) {
super(table, Phone.class, position);

type = new StringColumn<Phone, PhoneQuery>(table, this, 0, "type");
number = new StringColumn<Phone, PhoneQuery>(table, this, 1, "number");
type = new StringCursorColumn<Phone, PhoneQuery>(table, this, 0, "type");
number = new StringCursorColumn<Phone, PhoneQuery>(table, this, 1, "number");
}

public java.lang.String getType() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/customize.vm
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public class ${entity} extends AbstractCursor<${entity}> {

#foreach($f in $columns)
#if($f.code.attributes.isSubtable)
public final ${f.code.attributes.columnType}Column<${entity}, ${entity}Query, ${f.code.attributes.subtable}> ${f.name};
public final ${f.code.attributes.columnType}CursorColumn<${entity}, ${entity}Query, ${f.code.attributes.subtable}> ${f.name};
#else
public final ${f.code.attributes.columnType}Column<${entity}, ${entity}Query> ${f.name};
public final ${f.code.attributes.columnType}CursorColumn<${entity}, ${entity}Query> ${f.name};
#end
#end

Expand All @@ -133,9 +133,9 @@ public class ${entity} extends AbstractCursor<${entity}> {

#foreach($f in $columns)
#if($f.code.attributes.isSubtable)
${f.name} = new ${f.code.attributes.columnType}Column<${entity}, ${entity}Query, ${f.code.attributes.subtable}>(table, this, ${f.code.attributes.index}, "${f.name}", ${f.code.attributes.subtable}.class);
${f.name} = new ${f.code.attributes.columnType}CursorColumn<${entity}, ${entity}Query, ${f.code.attributes.subtable}>(table, this, ${f.code.attributes.index}, "${f.name}", ${f.code.attributes.subtable}.class);
#else
${f.name} = new ${f.code.attributes.columnType}Column<${entity}, ${entity}Query>(table, this, ${f.code.attributes.index}, "${f.name}");
${f.name} = new ${f.code.attributes.columnType}CursorColumn<${entity}, ${entity}Query>(table, this, ${f.code.attributes.index}, "${f.name}");
#end
#end
}
Expand Down

0 comments on commit 58d91aa

Please sign in to comment.