*/
@Override
public void initializeDefaultQueries(DescriptorQueryManager queryManager, AbstractSession session) {
// Insert
if (!queryManager.hasInsertQuery()) {
EISInteraction call = new MappedInteraction();
call.setProperty(MongoPlatform.OPERATION, MongoOperation.INSERT);
call.setProperty(MongoPlatform.COLLECTION, ((EISDescriptor)queryManager.getDescriptor()).getDataTypeName());
queryManager.setInsertCall(call);
}
// Update
if (!queryManager.hasUpdateQuery()) {
EISInteraction call = new MappedInteraction();
call.setProperty(MongoPlatform.OPERATION, MongoOperation.UPDATE);
call.setProperty(MongoPlatform.COLLECTION, ((EISDescriptor)queryManager.getDescriptor()).getDataTypeName());
queryManager.setUpdateCall(call);
}
// Read
if (!queryManager.hasReadObjectQuery()) {
MappedInteraction call = new MappedInteraction();
call.setProperty(MongoPlatform.OPERATION, MongoOperation.FIND);
call.setProperty(MongoPlatform.COLLECTION, ((EISDescriptor)queryManager.getDescriptor()).getDataTypeName());
for (DatabaseField field : queryManager.getDescriptor().getPrimaryKeyFields()) {
call.addArgument(field.getName());
}
queryManager.setReadObjectCall(call);
}
// Delete
if (!queryManager.hasDeleteQuery()) {
MappedInteraction call = new MappedInteraction();
call.setProperty(MongoPlatform.OPERATION, MongoOperation.REMOVE);
call.setProperty(MongoPlatform.COLLECTION, ((EISDescriptor)queryManager.getDescriptor()).getDataTypeName());
for (DatabaseField field : queryManager.getDescriptor().getPrimaryKeyFields()) {
call.addArgument(field.getName());
}
queryManager.setDeleteCall(call);
}
}