Package com.spaceprogram.simplejpa

Source Code of com.spaceprogram.simplejpa.AnnotationTests

package com.spaceprogram.simplejpa;

import org.junit.Test;
import org.scannotation.AnnotationDB;
import org.scannotation.ClasspathUrlFinder;

import javax.persistence.Entity;
import java.io.IOException;
import java.net.URL;
import java.util.Set;

/**
* User: treeder
* Date: Feb 8, 2008
* Time: 12:53:30 PM
*/
public class AnnotationTests {
    @Test
    public void findAnnotations() throws IOException {
        URL[] urls = ClasspathUrlFinder.findClassPaths(); // scan java.class.path
        AnnotationDB db = new AnnotationDB();
        db.scanArchives(urls);
        Set<String> entities = db.getAnnotationIndex().get(Entity.class.getName());
        for (String entity : entities) {
            System.out.println("entity=" + entity);
        }
    }
}
TOP

Related Classes of com.spaceprogram.simplejpa.AnnotationTests

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.