Automatic Mapping Scanning with Compass

Compass now supports (trunk) automatic scanning of different mappings definitions (a much requested feature). Here is a code example of how it can be used:

1
2
3
Compass compass = new CompassConfiguration().setConnection("test-index")
                 .addScan("com.mycompany", "**/model/**")
                 .buildCompass();

The above code will scan the package com.mycompany and match any sub package that has model in it (ant style pattern matching, can be null). The scanning process will scan for all the typical xml mapping definitions (ends with .cpm.xml), and will try and find classes with @Searchable annotations using either ASM or Javassist (if found in the classpath).

The scanner is supported both in the dtd based configuration and the schema based configuration. Enjoy!.

One Response to “Automatic Mapping Scanning with Compass”

  1. KimchyBlog » Blog Archive » Compass 2.0.0 RC1 Released Says:

    […] var gaJsHost = ((”https:” == document.location.protocol) ? “https://ssl.” : “http://www.”); document.write(unescape(”%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”)); var pageTracker = _gat._getTracker(”UA-3492838-2″); pageTracker._initData(); pageTracker._trackPageview(); « Automatic Mapping Scanning with Compass […]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>