-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented code generation for nested tables (issue #4).
- Loading branch information
1 parent
6e12e96
commit 65b155d
Showing
10 changed files
with
242 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* This file was automatically generated by TightDB. */ | ||
|
||
package com.tightdb.generated; | ||
|
||
|
||
import com.tightdb.*; | ||
import com.tightdb.lib.*; | ||
|
||
/** | ||
* This class represents a TightDB cursor and was automatically generated. | ||
*/ | ||
public class Phone extends AbstractCursor<Phone> { | ||
|
||
public final StringColumn<Phone, PhoneQuery> type; | ||
public final StringColumn<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"); | ||
} | ||
|
||
public java.lang.String getType() { | ||
return this.type.get(); | ||
} | ||
|
||
public void setType(java.lang.String type) { | ||
this.type.set(type); | ||
} | ||
|
||
public java.lang.String getNumber() { | ||
return this.number.get(); | ||
} | ||
|
||
public void setNumber(java.lang.String number) { | ||
this.number.set(number); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* This file was automatically generated by TightDB. */ | ||
|
||
package com.tightdb.generated; | ||
|
||
|
||
import com.tightdb.*; | ||
import com.tightdb.lib.*; | ||
|
||
/** | ||
* This class represents a TightDB query and was automatically generated. | ||
*/ | ||
public class PhoneQuery extends AbstractQuery { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* This file was automatically generated by TightDB. */ | ||
|
||
package com.tightdb.generated; | ||
|
||
|
||
import com.tightdb.*; | ||
import com.tightdb.lib.*; | ||
|
||
/** | ||
* This class represents a TightDB table and was automatically generated. | ||
*/ | ||
public class PhoneTable extends AbstractTable<Phone, PhoneView> { | ||
|
||
public final StringColumn<Phone, PhoneQuery> type = new StringColumn<Phone, PhoneQuery>(table, 0, "type"); | ||
public final StringColumn<Phone, PhoneQuery> number = new StringColumn<Phone, PhoneQuery>(table, 1, "number"); | ||
|
||
public PhoneTable() { | ||
super(Phone.class, PhoneView.class); | ||
} | ||
|
||
@Override | ||
protected void specifyStructure(TableSpec spec) { | ||
registerStringColumn(spec, "type"); | ||
registerStringColumn(spec, "number"); | ||
} | ||
|
||
public Phone add(String type, String number) { | ||
try { | ||
int position = size(); | ||
|
||
insertString(0, position, type); | ||
insertString(1, position, number); | ||
insertDone(); | ||
|
||
return cursor(position); | ||
} catch (Exception e) { | ||
throw addRowException(e); | ||
} | ||
|
||
} | ||
|
||
public Phone insert(long position, String type, String number) { | ||
try { | ||
insertString(0, position, type); | ||
insertString(1, position, number); | ||
insertDone(); | ||
|
||
return cursor(position); | ||
} catch (Exception e) { | ||
throw insertRowException(e); | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* This file was automatically generated by TightDB. */ | ||
|
||
package com.tightdb.generated; | ||
|
||
|
||
import com.tightdb.*; | ||
import com.tightdb.lib.*; | ||
|
||
/** | ||
* This class represents a TightDB view and was automatically generated. | ||
*/ | ||
public class PhoneView extends AbstractView<Phone, PhoneView> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.