Page tree
Skip to end of metadata
Go to start of metadata

If you are using MyBatis for SQL DB Abstraction this is for you.

Steps below related to configuring AOP plugin in your pom.xml:

  1.  add moskito-sql dependency
  2.  add moskito-sql as aspect library
  3.  add mybatis dependency to be weaved
  4.  add Xlint:warning property

Code snippet: 

pom.xml
...
<dependencies>
	...
	<dependency>
    	<groupId>net.anotheria</groupId>
    	<artifactId>moskito-sql</artifactId>
    	<version>${moskito.version}</version>
	</dependency>
	...
</dependencies>
...
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    ...
    <configuration>
        	...	
            <aspectLibraries>
		      ...	
              <aspectLibrary>
              	<groupId>net.anotheria</groupId>
                <artifactId>moskito-sql</artifactId>
              </aspectLibrary>
			  ...	
            </aspectLibraries>
            <weaveDependencies>
            	<weaveDependency>
                	<groupId>org.mybatis</groupId>
                    <artifactId>mybatis</artifactId>
                </weaveDependency>
            </weaveDependencies>
            <Xlint>warning</Xlint>
    </configuration>
	...
</plugin>
...


Compile and run your application, do some steps related to mybatis calls, find in moskito-inspect sql monitored calls: 

  • No labels