package com.farm.processes;

import com.farm.database.accounts.AccountBalance;
import com.farm.database.accounts.AccountBalanceRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;

/**
 * Farm project. 2017
 * Description:
 */
@Service
@Transactional
public class AccountBalanceProcess
{
  @Resource
  private AccountBalanceRepository accountBalanceRepository;

  public AccountBalance findOrCreateByAccountNumber(){

  }
}

@@ -22,16 +22,59 @@
 esses;%0A%0A
+import com.farm.database.accounts.Account;%0A
 import c
@@ -111,24 +111,24 @@
 untBalance;%0A
-
 import com.f
@@ -298,16 +298,57 @@
 ional;%0A%0A
+import static java.util.Objects.isNull;%0A%0A
 /**%0A * F
@@ -569,18 +569,157 @@
 ount
-Number()%7B%0A
+(Account account)%7B%0A    AccountBalance accountBalance = accountBalanceRepository.findByAccount(account);%0A    if (isNull(accountBalance))%7B%0A      %0A    %7D
 %0A  %7D

Work with account balance process