If you like to load environment specific spring configuration you can do this using profile. In other words, if you want to load a set of beans that have different settings on different environment (development, testing or production) you can use profile feature instead of pointing to a different spring xml configuration at each stage.
- How to use profile in spring xml configuration?
We have seen in Mybatis + Spring (XML | Annotation) Mapper how to write a simple mybatis-spring app and what is actually needed to get it up and running. Here I will extend that sample code to cover more stuff that you may face in a real “coding”. We will see how to make a single select that will fetch the one and the many of a “one-to-many” relationship, who to use mybatis config file with spring (if you need it), how to test mybatis-spring code using junit and things you need to watch out!
H2 embedded database has been used to make this example easy to run. But you still can use it with other databases e.g. “MySql, Oracle,….”
- How to use make a single select that will fetch all one to many records?
- How to reference mybatis config file in spring xml config file?
- How to test using junit?
This is a simple introduction to Spring Data Neo4j which provides simpler & Spring style development model.
- How to convert POJO to Neo4j entities?
- How to interact with Neo4j db using (Neo4jTemplate)?
The easiest way to return an object as JSON without using view resolver is to add @ResponseBody before return type.
- How to build a REST service using Spring MVC to return json without using view resolver?
Using myBatis with Spring framework. (XML configuration and mapping).
- How to use myBatis with Spring framework?
- How to write mybatis config and mapper in xml?
Connecting to relational database (MySQL) from Java application using Spring framework JDBC JdbcTemplate class.
- How to use Spring JDBC (JdbcTemplate) to connect database (MySql)?
- How to:
- insert(object) return id
- select(id) return object
- select(id) return single column
- select() return list of objects
- batchUpdate() more than one records!
- count() return # of rows!
Beans properties can be auto-wired “auto-set” using xml “Spring Bean Autowiring (XML)” or annotation “@Autowired”
- How to autowire bean using @Autowired annotation?
- Different usage of @Autowired?
Beans properties can be auto-wired “auto-set”!
- How to autowire?
- Different ways to autowire?
We can configure Spring AOP using XML, “as in First Time Spring AOP“, or Annotation.
- How to implement Spring AOP using annotation?
- Why to use annotation?