package com.farm.processes;

import com.farm.database.accounts.Account;
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;

import static java.util.Objects.isNull;

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

  public AccountBalance findOrCreateByAccount(Account account){
    AccountBalance accountBalance = accountBalanceRepository.findByAccount(account);
    if (isNull(accountBalance)){
      
    }
  }
}

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(){

  }
}

--- 
+++ 
@@ -1,11 +1,14 @@
 package com.farm.processes;
 
+import com.farm.database.accounts.Account;
 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;
+
+import static java.util.Objects.isNull;
 
 /**
  * Farm project. 2017
@@ -18,7 +21,10 @@
   @Resource
   private AccountBalanceRepository accountBalanceRepository;
 
-  public AccountBalance findOrCreateByAccountNumber(){
-
+  public AccountBalance findOrCreateByAccount(Account account){
+    AccountBalance accountBalance = accountBalanceRepository.findByAccount(account);
+    if (isNull(accountBalance)){
+      
+    }
   }
 }
Work with account balance process
