Commit 7a0eb8e3 by Nilu

fix issue with search applicant

parent 82dc9710
......@@ -9,7 +9,6 @@
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="xxxx" type="CLOB" nullable="true"/>
<column name="xxxx" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -8,8 +8,7 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
xxxx text NULL,
xxxx numeric(12) NULL
xxxx text NULL
);
......
......@@ -9,8 +9,7 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
xxxx clob NULL,
xxxx number(12) NULL
xxxx clob NULL
);
......
......@@ -9,8 +9,7 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
xxxx text NULL,
xxxx numeric(12) NULL
xxxx text NULL
);
......
package performa.search;
import oneit.objstore.BaseBusinessClass;
import oneit.objstore.rdbms.filters.EqualsFilter;
import performa.orm.JobApplication;
public class SearchApplicant extends BaseSearchApplicant
{
......@@ -14,13 +10,4 @@ public class SearchApplicant extends BaseSearchApplicant
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public BaseBusinessClass[] doSearch()
{
return JobApplication.SearchByDetails()
.byName(getDetails())
.andJob(new EqualsFilter<>(getJob()))
.search(getTransaction());
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="SearchJob" package="performa.search" superclass="SearchExecutor" >
<BUSINESSCLASS name="SearchApplicant" package="performa.search" superclass="SearchExecutor" >
<IMPORT value="oneit.servlets.orm.*" />
......
......@@ -15,7 +15,6 @@ import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.servlets.orm.*;
import performa.orm.*;
......@@ -43,7 +42,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
}
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -94,8 +93,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
// Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Details)||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.SINGLEREFERENCE_Job))
!it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Details))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
......@@ -165,10 +163,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " +
"SET xxxx = ?, xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -404,7 +402,6 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
it_does_not_matterPSet.setAttrib(SearchApplicant.FIELD_Details, HELPER_Details.getFromRS(dummyDetails, r, "xxxx"));
it_does_not_matterPSet.setAttrib(SearchApplicant.SINGLEREFERENCE_Job, r.getObject ("xxxx"));
}
......@@ -421,10 +418,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " +
" (xxxx, xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))) .listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment