BAEL-696 - Implement OR in the REST API Query Language (#1404)

* Dependency Injection Types, XML-Config, Java-Config, Test Classes

* Formatting done with Formatter Configuration in Eclipse

* REST Query Lang - Adv Search Ops - Improvement - C1

* REST Query Lang - Adv Search Ops - Improvement - C2

* add update to rest api (#1401)

* upgrade to spring boot 1.5.2

* add full update to REST API

* BAEL-634 javassist (#1349)

* BEEL-634 javassist dependency

* BEEL-634 code for javassist article

* BEEL-634 test refinement

* BEEL-634 increment lib to newest version

* add test that uses reflection to verify

* add field

* add bytecode to different class

* adding following modules with updated testcase : DB, Filter, Json (#1410)

* adding ratpack module

* adding pom.xml

* adding following modules with updated testcase : DB, Filter, Json

* add entry points (#1413)

* spring boot custom banner (#1412)

* adding ratpack module

* adding pom.xml

* adding following modules with updated testcase : DB, Filter, Json

* adding spring-boot custom banner tutorial

* BALE-707 Refactoring changes (#1418)

* BAEL-707 Add the changes as per review comment

* BAEL-707 Refactored the code as per review comments

* BAEL-696 Code formatting
This commit is contained in:
ahamedm
2017-03-16 14:49:13 +04:00
committed by pedja4
parent de29f6af4b
commit 26b5ab860a
20 changed files with 898 additions and 413 deletions
@@ -0,0 +1,17 @@
package com.baeldung.beaninjection;
public class AnotherSampleDAOBean implements IAnotherSampleDAO {
private String propertyY;
public AnotherSampleDAOBean(String propertyY) {
this.propertyY = propertyY;
}
// standard setters and getters
public String getPropertyY() {
return propertyY;
}
}
@@ -0,0 +1,39 @@
package com.baeldung.beaninjection;
import java.util.List;
public class ExampleDAOBean implements IExampleDAO {
private String propertyX;
public ExampleDAOBean(String propertyX) {
this.propertyX = propertyX;
}
public String getPropertyX() {
return propertyX;
}
public void setPropertyX(String propertyX) {
this.propertyX = propertyX;
}
@Override
public List<SampleDomainObject> getDomainList() {
// TODO Auto-generated method stub
return null;
}
@Override
public SampleDomainObject createNewDomain(SampleDomainObject inputDomain) {
// TODO Auto-generated method stub
return null;
}
@Override
public SampleDomainObject getSomeDomain() {
// TODO Auto-generated method stub
return new SampleDomainObject();
}
}
@@ -0,0 +1,47 @@
package com.baeldung.beaninjection;
import java.util.List;
public class ExampleServiceBean implements IExampleService {
private IExampleDAO exampleDAO;
private IAnotherSampleDAO anotherSampleDAO;
public ExampleServiceBean(IExampleDAO exampleDAO) {
this.exampleDAO = exampleDAO;
}
public void setAnotherSampleDAO(IAnotherSampleDAO anotherSampleDAO) {
this.anotherSampleDAO = anotherSampleDAO;
}
// standard setters and getters
public IAnotherSampleDAO getAnotherSampleDAO() {
return anotherSampleDAO;
}
public void setExampleDAO(ExampleDAOBean exampleDAO) {
this.exampleDAO = exampleDAO;
}
public IExampleDAO getExampleDAO() {
return exampleDAO;
}
private String propertyX;
public String getPropertyX() {
return propertyX;
}
public void setPropertyX(String propertyX) {
this.propertyX = propertyX;
}
public List<SampleDomainObject> serviceMethodX() {
/*get domain list from DAO .. business logic on domain objects..return*/
return exampleDAO.getDomainList();
}
}
@@ -0,0 +1,5 @@
package com.baeldung.beaninjection;
public interface IAnotherSampleDAO {
}
@@ -0,0 +1,12 @@
package com.baeldung.beaninjection;
import java.util.List;
public interface IExampleDAO {
List<SampleDomainObject> getDomainList();
SampleDomainObject createNewDomain(SampleDomainObject domainObject);
SampleDomainObject getSomeDomain();
}
@@ -0,0 +1,9 @@
package com.baeldung.beaninjection;
import java.util.List;
public interface IExampleService {
List<SampleDomainObject> serviceMethodX();
}
@@ -0,0 +1,31 @@
package com.baeldung.beaninjection;
import java.io.Serializable;
public class SampleDomainObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = 449859763481296747L;
private String domainPropX;
private String domainPropY;
public String getDomainPropX() {
return domainPropX;
}
public void setDomainPropX(String domainPropX) {
this.domainPropX = domainPropX;
}
public String getDomainPropY() {
return domainPropY;
}
public void setDomainPropY(String domainPropY) {
this.domainPropY = domainPropY;
}
}
@@ -0,0 +1,36 @@
package com.baeldung.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.baeldung.beaninjection.AnotherSampleDAOBean;
import com.baeldung.beaninjection.ExampleDAOBean;
import com.baeldung.beaninjection.ExampleServiceBean;
import com.baeldung.beaninjection.IAnotherSampleDAO;
import com.baeldung.beaninjection.IExampleDAO;
import com.baeldung.beaninjection.IExampleService;
@Configuration
@ComponentScan(basePackages = { "com.baeldung.beaninjection" })
public class ApplicationContextTestBeanInjectionTypes {
@Bean
public IExampleDAO exampleDAO() {
return new ExampleDAOBean("Mandatory DAO Property X");
}
@Bean
public IExampleService exampleServiceBean() {
ExampleServiceBean serviceBean = new ExampleServiceBean(exampleDAO());
serviceBean.setAnotherSampleDAO(anotherSampleDAO());
serviceBean.setPropertyX("Some Service Property X");
return serviceBean;
}
@Bean
public IAnotherSampleDAO anotherSampleDAO() {
return new AnotherSampleDAOBean("Mandatory DAO Property Y");
}
}
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="exampleDAO" class="com.baeldung.beaninjection.ExampleDAOBean">
<constructor-arg index="0" type="java.lang.String"
value="Mandatory DAO Property X" />
</bean>
<bean id="anotherSampleDAO" class="com.baeldung.beaninjection.AnotherSampleDAOBean">
<constructor-arg index="0" type="java.lang.String"
value="Mandatory DAO Property Y" />
</bean>
<bean id="exampleService" class="com.baeldung.beaninjection.ExampleServiceBean">
<constructor-arg index="0" ref="exampleDAO" />
<property name="propertyX" value="Some Service Property X"></property>
<property name="anotherSampleDAO" ref="anotherSampleDAO"></property>
</bean>
</beans>