Имеется несколько проблем с Ormlite и Android / Sqlite, поэтому любая помощь приветствуется. Структура базы данных
"CREATE TABLE [jobTasks](" +
"[JobTaskID] varchar(50) NOT NULL PRIMARY KEY DEFAULT (newid())," +
"[JobID] varchar(50) NOT NULL," +
"[EnumTaskType] Real," +
"[TaskID] varchar(50)," +
"[TaskOrder] SmallInt," +
"[TaskDescription] NVarChar (50) ," +
"[EnumTaskStatus] Real," +
"[EnumTaskQualifier] Real," +
"[IsTaskQualifierForced] Bit," +
"[CompletedBy] NVarChar (50)," +
"[CompletedOn] DateTime," +
"[CompletedOnOffset] NVarChar (6)," +
"[JobAssetID] varchar(50),[wadtDeleted] Bit NOT NULL DEFAULT ((0))," +
"[WadtModifiedBy] NVarChar (15)," +
"[WadtModifiedOn] DateTime," +
"[WadtModifiedOnDTOffset] NVarChar (6)," +
"[WadtRowID] varchar(50) DEFAULT (newid())," +
"[ParentJobTaskID] varchar(50)," +
"[Rowguid] varchar(50) NOT NULL DEFAULT (newid())," +
"SyncDeleted Bit NOT NULL DEFAULT ((0))," +
"FOREIGN KEY(JobID) REFERENCES jobJob(jobID)," +
"FOREIGN KEY(enumTaskType) REFERENCES enumTaskType(enumTaskType)," +
"FOREIGN KEY(TaskID) REFERENCES cfgWorkFlowTasks(TaskID)," +
"FOREIGN KEY(enumTaskStatus) REFERENCES enumTaskStatus(enumTaskStatus))"
Запрос
QueryBuilder<JobParentTask, String> qb =
_databaseContext.JobParentTasks().queryBuilder();
qb.orderBy(JobParentTask.TASKORDER, true);
qb.where().eq(JobParentTask.JOBID, id).and()
.isNull(JobParentTask.PARENTJOBTASKID);
PreparedQuery<JobParentTask> preparedQuery = queryBuilder.prepare();
CloseableIterator<JobParentTask> iterator
=_databaseContext.JobParentTasks().iterator(jobParentTaskPreparedQuery);
while (iterator.hasNext()) {
parentTasks.add(iterator.next());
}
Выдается следующая ошибка
unrecognized token: "6B582835": , while compiling:
SELECT * FROM `jobTasks` WHERE
`JobID` = 6B582835-5A79-E011-A5E4-005056980009 AND `ParentJobTaskID` IS NULL )
ORDER BY `TaskOrder`
Если я передаю идентификатор в виде строкового значения, почему он не отображается как таковой в запросе?
Последняя ошибка
java.sql.SQLException: Could not build prepared-query iterator for class
conx.Entities.JobParentTask
Я полагаю, это связано с исходной ошибкой?
Заранее спасибо