public void bind(final SQLStatement q, final BusinessOverdueStatusBinder bind, final BusinessOverdueStatusModelDao overdueStatus) { q.bind("account_key", overdueStatus.getAccountKey()); q.bind("bundle_id", overdueStatus.getBundleId().toString()); q.bind("external_key", overdueStatus.getExternalKey()); q.bind("status", overdueStatus.getStatus()); if (overdueStatus.getStartDate() != null) { q.bind("start_date", overdueStatus.getStartDate().getMillis()); } else { q.bindNull("start_date", Types.BIGINT); } if (overdueStatus.getEndDate() != null) { q.bind("end_date", overdueStatus.getEndDate().getMillis()); } else { q.bindNull("end_date", Types.BIGINT); } } };
q.bindNull("prev_product_name", Types.VARCHAR); q.bindNull("prev_product_type", Types.VARCHAR); q.bindNull("prev_product_category", Types.VARCHAR); q.bindNull("prev_slug", Types.VARCHAR); q.bindNull("prev_phase", Types.VARCHAR); q.bindNull("prev_billing_period", Types.VARCHAR); q.bindNull("prev_price", Types.NUMERIC); q.bindNull("prev_price_list", Types.VARCHAR); q.bindNull("prev_mrr", Types.NUMERIC); q.bindNull("prev_currency", Types.VARCHAR); q.bindNull("prev_start_date", Types.BIGINT); q.bindNull("prev_state", Types.VARCHAR); } else { q.bind("prev_product_name", previousSubscription.getProductName()); q.bind("prev_product_type", previousSubscription.getProductType()); if (previousSubscription.getProductCategory() == null) { q.bindNull("prev_product_category", Types.VARCHAR); } else { q.bind("prev_product_category", previousSubscription.getProductCategory().toString()); q.bind("prev_currency", previousSubscription.getCurrency()); if (previousSubscription.getStartDate() == null) { q.bindNull("prev_start_date", Types.BIGINT); } else { q.bind("prev_start_date", previousSubscription.getStartDate().getMillis()); q.bindNull("prev_state", Types.VARCHAR); } else { q.bind("prev_state", previousSubscription.getState().toString());
if (context.getTenantRecordId() == null) { q.bindNull("tenantRecordId", Types.INTEGER); } else { q.bind("tenantRecordId", context.getTenantRecordId()); q.bindNull("accountRecordId", Types.INTEGER); } else { q.bind("accountRecordId", context.getAccountRecordId()); q.bind("userName", callContext.getCreatedBy()); if (callContext.getCreatedDate() == null) { q.bindNull("createdDate", Types.DATE); } else { q.bind("createdDate", callContext.getCreatedDate().toDate()); q.bindNull("updatedDate", Types.DATE); } else { q.bind("updatedDate", callContext.getUpdatedDate().toDate());
q.bind("invoice_number", invoice.getInvoiceNumber()); } else { q.bindNull("invoice_number", Types.BIGINT); q.bind("invoice_date", invoice.getInvoiceDate().toDate()); } else { q.bindNull("invoice_date", Types.DATE); q.bind("target_date", invoice.getTargetDate().toDate()); } else { q.bindNull("target_date", Types.DATE);
q.bind("linked_item_id", invoiceItem.getLinkedItemId().toString()); } else { q.bindNull("linked_item_id", Types.VARCHAR); q.bind("start_date", invoiceItem.getStartDate().toDate()); } else { q.bindNull("start_date", Types.DATE); q.bind("end_date", invoiceItem.getEndDate().toDate()); } else { q.bindNull("end_date", Types.DATE);
public void bind(final SQLStatement q, final BusinessAccountBinder bind, final BusinessAccountModelDao account) { final DateTime dateTimeNow = new DateTime(DateTimeZone.UTC); if (account.getCreatedDate() != null) { q.bind("created_date", account.getCreatedDate().getMillis()); } else { q.bind("created_date", dateTimeNow.getMillis()); } if (account.getUpdatedDate() != null) { q.bind("updated_date", account.getUpdatedDate().getMillis()); } else { q.bind("updated_date", dateTimeNow.getMillis()); } q.bind("account_id", account.getAccountId().toString()); q.bind("account_key", account.getKey()); q.bind("balance", account.getRoundedBalance()); q.bind("name", account.getName()); if (account.getLastInvoiceDate() != null) { q.bind("last_invoice_date", account.getLastInvoiceDate().toDate()); } else { q.bindNull("last_invoice_date", Types.DATE); } q.bind("total_invoice_balance", account.getRoundedTotalInvoiceBalance()); q.bind("last_payment_status", account.getLastPaymentStatus()); q.bind("payment_method", account.getPaymentMethod()); q.bind("credit_card_type", account.getCreditCardType()); q.bind("billing_address_country", account.getBillingAddressCountry()); q.bind("currency", account.getCurrency()); } };
public void bind(final SQLStatement query, final TimelineChunkBinder binder, final TimelineChunk timelineChunk) { query.bind("sourceRecordId", timelineChunk.getSourceId()) .bind("metricRecordId", timelineChunk.getMetricId()) .bind("sampleCount", timelineChunk.getSampleCount()) .bind("startTime", DateTimeUtils.unixSeconds(timelineChunk.getStartTime())) .bind("endTime", DateTimeUtils.unixSeconds(timelineChunk.getEndTime())) .bind("aggregationLevel", timelineChunk.getAggregationLevel()) .bind("notValid", timelineChunk.getNotValid() ? 1 : 0) .bind("dontAggregate", timelineChunk.getDontAggregate() ? 1 : 0); final byte[] times = timelineChunk.getTimeBytesAndSampleBytes().getTimeBytes(); final byte[] samples = timelineChunk.getTimeBytesAndSampleBytes().getSampleBytes(); final byte[] timesAndSamples = TimesAndSamplesCoder.combineTimesAndSamples(times, samples); if (timelineChunk.getChunkId() == 0) { query.bindNull("chunkId", Types.BIGINT); } else { query.bind("chunkId", timelineChunk.getChunkId()); } if (timesAndSamples.length > MAX_IN_ROW_BLOB_SIZE) { query.bindNull("inRowSamples", Types.VARBINARY) .bind("blobSamples", timesAndSamples); } else { query.bind("inRowSamples", timesAndSamples) .bindNull("blobSamples", Types.BLOB); } } };