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());
}
};