-
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.
Introduced query-only columns for all column types (issue #11).
- Loading branch information
1 parent
2b66f6d
commit cc81b89
Showing
16 changed files
with
187 additions
and
56 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,15 @@ | ||
package com.tightdb.lib; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class BinaryQueryColumn<Cursor, Query> extends AbstractColumn<byte[], Cursor, Query> { | ||
|
||
public BinaryQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name) { | ||
super(table, cursor, index, name); | ||
} | ||
|
||
public BinaryQueryColumn(TableBase table, int index, String name) { | ||
super(table, index, name); | ||
} | ||
|
||
} |
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,15 @@ | ||
package com.tightdb.lib; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class BooleanQueryColumn<Cursor, Query> extends AbstractColumn<Boolean, Cursor, Query> { | ||
|
||
public BooleanQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name) { | ||
super(table, cursor, index, name); | ||
} | ||
|
||
public BooleanQueryColumn(TableBase table, int index, String name) { | ||
super(table, index, name); | ||
} | ||
|
||
} |
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,17 @@ | ||
package com.tightdb.lib; | ||
|
||
import java.util.Date; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class DateQueryColumn<Cursor, Query> extends AbstractColumn<Date, Cursor, Query> { | ||
|
||
public DateQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name) { | ||
super(table, cursor, index, name); | ||
} | ||
|
||
public DateQueryColumn(TableBase table, int index, String name) { | ||
super(table, index, name); | ||
} | ||
|
||
} |
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,31 @@ | ||
package com.tightdb.lib; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class LongQueryColumn<Cursor, Query> extends AbstractColumn<Long, Cursor, Query> { | ||
|
||
public LongQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name) { | ||
super(table, cursor, index, name); | ||
} | ||
|
||
public LongQueryColumn(TableBase table, int index, String name) { | ||
super(table, index, name); | ||
} | ||
|
||
public Query greaterThan(int value) { | ||
return null; | ||
} | ||
|
||
public Query lessThan(int value) { | ||
return null; | ||
} | ||
|
||
public Query between(int from, int to) { | ||
return null; | ||
} | ||
|
||
public Query is(long value) { | ||
return null; | ||
} | ||
|
||
} |
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,17 @@ | ||
package com.tightdb.lib; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class MixedQueryColumn<Cursor, Query> extends AbstractColumn<Serializable, Cursor, Query> { | ||
|
||
public MixedQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name) { | ||
super(table, cursor, index, name); | ||
} | ||
|
||
public MixedQueryColumn(TableBase table, int index, String name) { | ||
super(table, index, name); | ||
} | ||
|
||
} |
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,31 @@ | ||
package com.tightdb.lib; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class StringQueryColumn<Cursor, Query> extends AbstractColumn<String, Cursor, Query> { | ||
|
||
public StringQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name) { | ||
super(table, cursor, index, name); | ||
} | ||
|
||
public StringQueryColumn(TableBase table, int index, String name) { | ||
super(table, index, name); | ||
} | ||
|
||
public Query startsWith(String value) { | ||
return null; | ||
} | ||
|
||
public Query endWith(String value) { | ||
return null; | ||
} | ||
|
||
public Query contains(String value) { | ||
return null; | ||
} | ||
|
||
public Query matches(String regex) { | ||
return null; | ||
} | ||
|
||
} |
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,32 @@ | ||
package com.tightdb.lib; | ||
|
||
import com.tightdb.TableBase; | ||
|
||
public class TableQueryColumn<Cursor, Query, Subtable> extends AbstractColumn<Subtable, Cursor, Query> { | ||
|
||
protected Subtable subtable; | ||
|
||
public TableQueryColumn(TableBase table, AbstractCursor<Cursor> cursor, int index, String name, Class<Subtable> subtableClass) { | ||
super(table, cursor, index, name); | ||
try { | ||
subtable = subtableClass.newInstance(); | ||
} catch (Exception e) { | ||
throw new RuntimeException("Cannot create subtable instance!", e); | ||
} | ||
} | ||
|
||
public TableQueryColumn(TableBase table, int index, String name, Class<Subtable> subtableClass) { | ||
super(table, index, name); | ||
try { | ||
subtable = subtableClass.newInstance(); | ||
} catch (Exception e) { | ||
throw new RuntimeException("Cannot create subtable instance!", e); | ||
} | ||
} | ||
|
||
@Override | ||
public String getReadable() { | ||
return "subtable"; | ||
} | ||
|
||
} |