Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.MapLoader


        for (int i = 0; i < maps.length; i++) {
            InputStream stream = getClass().getClassLoader().getResourceAsStream(
                    DATA_MAPS_REQUIREING_SCHEMA_SETUP[i]);
            InputSource in = new InputSource(stream);
            in.setSystemId(DATA_MAPS_REQUIREING_SCHEMA_SETUP[i]);
            maps[i] = new MapLoader().loadDataMap(in);
        }

        this.domain = new DataDomain("temp");
        domain.setEventManager(new DefaultEventManager(2));
        domain.setEntitySorter(new AshwoodEntitySorter());
View Full Code Here


    protected MapLoader getMapLoader() {
        // it is worth caching the map loader, as it precompiles some XML operations
        // starting from release 3.0
        if (mapLoader == null) {
            mapLoader = new MapLoader();
        }

        return mapLoader;
    }
View Full Code Here

    @Override
    protected void postInitialize(File projectFile) {
        if (projectFile != null) {
            try {
                InputStream in = new FileInputStream(projectFile.getCanonicalFile());
                map = new MapLoader().loadDataMap(new InputSource(in));

                String fileName = resolveSymbolicName(projectFile);
                String mapName = (fileName != null && fileName
                        .endsWith(DataMapFile.LOCATION_SUFFIX))
                        ? fileName.substring(0, fileName.length()
View Full Code Here

    protected MapLoader getMapLoader() {
        // it is worth caching the map loader, as it precompiles some XML operations
        // starting from release 3.0
        if (mapLoader == null) {
            mapLoader = new MapLoader();
        }

        return mapLoader;
    }
View Full Code Here

    @Override
    protected void postInitialize(File projectFile) {
        if (projectFile != null) {
            try {
                InputStream in = new FileInputStream(projectFile.getCanonicalFile());
                map = new MapLoader().loadDataMap(new InputSource(in));

                String fileName = resolveSymbolicName(projectFile);
                String mapName = (fileName != null && fileName
                        .endsWith(DataMapFile.LOCATION_SUFFIX))
                        ? fileName.substring(0, fileName.length()
View Full Code Here

    private File[] additionalDataMapFiles;
    private DataMap mainDataMap;

    DataMap getMainDataMap() throws MalformedURLException {
        if (mainDataMap == null) {
            MapLoader mapLoader = new MapLoader();

            DataMap mainDataMap = loadDataMap(mapLoader, mainDataMapFile);

            if (additionalDataMapFiles != null) {
View Full Code Here

    }

    /** Loads and returns DataMap based on <code>map</code> attribute. */
    protected DataMap loadDataMap() throws Exception {
        InputSource in = new InputSource(map.getCanonicalPath());
        return new MapLoader().loadDataMap(in);
    }
View Full Code Here

public class CAY_236Test extends BasicCase {

    private static final String TABLE1_BY = "\u0442\u0430\u0431\u043bi\u0446\u04301";

    public void testLoadUTF8() throws Exception {
        MapLoader loader = new MapLoader();

        // the idea here is to avoid passing the reader to the loader, and make sure the
        // loader does the right thing (i.e. loads UTF-8 encoded file) itself.
        DataMap map = loader.loadDataMap("i18n/by/DataMap.map.xml");
        assertNotNull(map.getDbEntity(TABLE1_BY));
    }
View Full Code Here

        DataMap map = loader.loadDataMap("i18n/by/DataMap.map.xml");
        assertNotNull(map.getDbEntity(TABLE1_BY));
    }

    public void testStoreUTF8() throws Exception {
        MapLoader loader = new MapLoader();

        // the idea here is to avoid passing the reader to the loader, and make sure the
        // loader does the right thing (i.e. loads UTF-8 encoded file) itself.
        DataMap map = loader.loadDataMap("i18n/by/DataMap.map.xml");

        File mapFile = new File(getTestDir(), "CAY_236Map.map.xml");
        TestProjectFile file = new TestProjectFile(map, "DataMap", mapFile);
        file.saveTemp();
View Full Code Here

     */
    protected void postInitialize(File projectFile) {
        if (projectFile != null) {
            try {
                InputStream in = new FileInputStream(projectFile.getCanonicalFile());
                map = new MapLoader().loadDataMap(new InputSource(in));

                String fileName = resolveSymbolicName(projectFile);
                logObj.error("resolving: " + projectFile + " to " + fileName);
                String mapName = (fileName != null && fileName
                        .endsWith(DataMapFile.LOCATION_SUFFIX))
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.MapLoader

Copyright © 2018 www.massapicom. 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.