This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean(name = "jdbcTemplateForFileH2DataBaseInRealisation") | |
public JdbcTemplate buildTemplate() throws SQLException, IOException { | |
try { | |
// For server with classpath: WEB-INF/classes/init_db2 | |
RunScript.execute(dataSource.getConnection(), new FileReader(new ClassPathResource("init_db2").getFile())); | |
} catch (final IOException e) { | |
LOGGER.error("new ClassPathResource(\"init_db2\").getFile() NOT FOUND. USING CONFIGURATION FOR LOCAL MACHINE." , e); | |
// For local machine with resource: ./src/main/resources/init_db2 | |
RunScript.execute(dataSource.getConnection(), new FileReader("./src/main/resources/init_db2")); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets List<T> from Mvc result Json path. | |
* | |
* @param mvcResult - MvcResult from resource test | |
* @param listJsonPath - list Json path | |
* @param <T> - types of elements of the list | |
* @return List<T> | |
*/ | |
public <T> List<T> getListFromMvcResultJsonPath(final MvcResult mvcResult, final JsonPath listJsonPath) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("Not presented method findByTwoLetterCode(). Fix it in shortest possible time.") | |
@Ignore | |
@Test | |
public void testFindByTwoLetterCode() { | |
CountryData countryData = new CountryData(); | |
String twoLetterCode = "AZ"; | |
countryData.code2 = twoLetterCode; | |
Long countryId = countryDB.create(countryData); | |
Country country = countryDB.findByTwoLetterCode("AZ"); | |
Assert.assertEquals(countryId, country.id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SQLQueryFactory for Querydsl querying*/ | |
private SQLQueryFactory queryFactory; | |
/* Q - generated objects for use in the Querydsl querying*/ | |
private static QCard card = QCard.card; | |
private static QAccounts account = QAccounts.accounts; | |
private static QCustomer customer = QCustomer.customer; | |
private static QBankBranch bankBranch = QBankBranch.bankBranch; | |
/** | |
* Gets accounts by parameters and searchText term. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SQLQueryFactory for Querydsl querying8*/ | |
private SQLQueryFactory queryFactory; | |
/* Q - generated objects for use in the Querydsl querying*/ | |
private static QDeposit deposit = QDeposit.deposit; | |
private static QAccounts account = QAccounts.accounts; | |
private static QCustomer customer = QCustomer.customer; | |
/*@Query("select u from Deposit u" + | |
" where (u.currency=:depositCurrency or :depositCurrency is null)" + | |
"and(u.depositType=:depositType or :depositType is null)" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.SQLException; | |
public class ConstructorWithExceptions { | |
public class Parent { | |
public Parent() throws SQLException { | |
} | |
public void method() throws Exception { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IntegerPool { | |
public static void main(String[] args) { | |
Integer i1 = 10; | |
Integer i2 = 10; | |
System.out.println(i1 == i2);// true, value < 128 | |
System.out.println("======================"); | |
Integer i3 = 300; | |
Integer i4 = 300; | |
System.out.println(i3 == i4); // false, value >= 128 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderOrganization(doc) { | |
return <div> | |
<span | |
style={ { fontSize: '14px' } }>{ highlight(doc.card.account.customer.organization.name, this.state.filter.searchText) }</span> | |
<br/> | |
<span>{ translate('common_TaxCode') }: { highlight(doc.card.account.customer.organization.taxCode, this.state.filter.searchText) } </span> | |
</div>; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetchRows = window => { | |
if (window['groupId'] === null || window['groupId'] === undefined || window['groupId'] === 0) { | |
delete window['groupId']; | |
} | |
return get('/constants', this.isFilterNotEmpty() ? window : Object.assign(window, { sort: 'propertyGroupId', order: 'asc' })); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Long setCardDisplayOrder(final Long cardId, final Double displayOrder) { | |
if (cardId == null || cardId == 0 || displayOrder == null) return 0L; | |
return cardRepositoryDB.setCardDisplayOrder(cardId, displayOrder); | |
} |
NewerOlder