Examples of DataSourceType


Examples of com.volantis.synergetics.reporting.config.DataSourceType

    public Object unmarshal(Object object, IUnmarshallingContext context)
            throws JiBXException {
        final DatasourceConfiguration datasource;
        final UnmarshallingContext ctx = (UnmarshallingContext) context;       
       
        final DataSourceType type = DataSourceType.literal(ctx.toStart());
       
        if (type == DataSourceType.JDBC_DATASOURCE) {
            datasource = unmarshalJDBCDatasource(ctx);
        } else if (type == DataSourceType.INTERNAL_POOL_DATASOURCE) {
            datasource = unmarshalInternalPoolDatasource(ctx);
View Full Code Here

Examples of com.volantis.synergetics.reporting.config.DataSourceType

    // javadoc inherited
    public void marshal(Object arg0, IMarshallingContext context)
            throws JiBXException {
        MarshallingContext ctx = (MarshallingContext) context;
        DatasourceConfiguration dataSource = (DatasourceConfiguration) arg0;
        DataSourceType type = dataSource.getType();
        if (type == DataSourceType.JDBC_DATASOURCE) {
            JDBCDatasource jdbcDatasource = (JDBCDatasource) dataSource;
            ctx.startTag(index, JDBC_DATASOURCE_TAG_NAME);

            writeTagsTextContent(ctx, DRIVER_CLASS_TAG_NAME,
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

            istream.close();
         }
      }

      XMLMetadata metadata = new XMLMetadata("new", root.toURL(), null, null, null);
      DataSourceType dstype = new DataSourceType("RelationalDatabase");

      dstype.setMetadata(metadata);
      dstype.setExporter(XMLRelationalMetadataExporter.class);
      m_database.setType(dstype);
      metadata.addDataSource(m_database);
      ((RelationalSchema)m_database.getSchema()).generateMetaclasses(getProperty("meta.prefix"), properties, null);

      for (Iterator itr = metadata.getMetaclassIterator(); itr.hasNext();)
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

   public void testRequiredColumnWithNullConverter()
   {
      RelationalSchema schema = new RelationalSchema();
      RelationalDatabase ds = new RelationalDatabase(null);
      DataSourceType dsType = new DataSourceType(null);
      Table table = new Table(schema);
      Column column = new Column("testColumn", table);
      Component converter = new Component(null, NullConverter.class, Component.SINGLETON);

      converter.addPrimitivePropertyInitializer("type", Primitive.TIMESTAMP);
      converter.addPrimitivePropertyInitializer("value", "1800-01-01 00:00:00");
      column.setType(Primitive.TIMESTAMP); // something that's not a String
      column.setNullable(false);
      column.setConverter(converter);
      table.setName("TestTable");
      table.addColumn(column);
      dsType.setMetadata(new XMLMetadata(null, null, null, null, null));
      ds.setType(dsType);
      schema.addTable(table);
      schema.setDataSource(ds);
      schema.generateMetaclasses(null, null, null);
      assertFalse(schema.getMetaclass("TestTable").getAttribute("testColumn").isRequired());
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

                     '/'));
      assertEquals("[non-collection:default-value]", output.toString());

      // set schema.getMetadata().isTestEnvironment() return value for test
      XMLMetadata metadata = new XMLMetadata(null, null, null, null, null);
      DataSourceType dsType = new DataSourceType(null);
      DataSource ds = new DataSource(null) {};

      dsType.setMetadata(metadata);
      ds.setType(dsType);
      schema.setDataSource(ds);

      // iftest enabled
      metadata.setTestEnvironment(true);
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

      step.setViewScript(upgradeScript);
      schema.addTable(table);
      schema.setDataSource(ds);
      ds.setAdapter(m_database.getSchema().getDataSource().getAdapter());
      ds.setSchema(schema);
      ds.setType(new DataSourceType(null));
      ds.getType().setMetadata(metadata);
      version.setDataSource(ds);
      version.addStep(step);
      metadata.setVersion(version.getName());
      upgrade.setMetadata(metadata);
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

      RelationalSchemaUpgrade upgradeVersion;

      ds.setAdapter(valid);
      ds.setComponent(new Component("Component"));
      ds.setSchema(schema);
      ds.setType(new DataSourceType("DataSourceType"));
      ds.getType().setMetadata(metadata);
      ds.getType().addAdapter(ds.getAdapter());
      ds.getType().addAdapter(invalid);
      ((RelationalDatabaseFragment)ds.getDefaultFragment()).setDatabase("Database");
      metadata.addDataSource(ds);
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

    */
   protected void loadDataSourceType(Element dstElement, String sName)
   {
      XMLMetadataHelper.verifyRootElement(dstElement, "DataSourceType");

      final DataSourceType type = new DataSourceType(sName);

      type.setMetadata(m_metadata);
      type.setLoader(m_helper.getClassObject(XMLUtil.getReqStringAttr(dstElement, "loader")));

      String sExporter = XMLUtil.getStringAttr(dstElement, "exporter");

      if (sExporter != null)
      {
         type.setExporter(m_helper.getClassObject(sExporter));
      }

      String sElement = XMLUtil.getReqStringAttr(dstElement, "element");

      XMLMetadataHelper.validateName(sElement);
      m_metadata.addDataSourceTypeElement(sElement, type);

      XMLUtil.withFirstChildElement(dstElement, "Adapters", false, new ElementHandler()
      {
         public void handleElement(Element adaptersElement)
         {
            XMLUtil.forEachChildElement(adaptersElement, "Adapter",
               m_helper.new ElementHandler("adapter")
            {
               public void handleElement(Element adapterElement, String sAdapterName)
               {
                  DataSourceAdapter adapter = new DataSourceAdapter(sAdapterName);

                  try
                  {
                     adapter.setType(type);
                     adapter.setClassObject(m_helper.getClassObject(XMLUtil.getReqStringAttr(adapterElement, "class")));
                     adapter.setVersion(XMLUtil.getStringAttr(adapterElement, "version"));
                     type.addAdapter(adapter);
                  }
                  catch (MetadataException e)
                  {
                     if (!(e.getCause() instanceof ClassNotFoundException) &&
                        !(e.getCause() instanceof NoClassDefFoundError))
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

    * @param dataSourceElement The DOM element containing the data source.
    * @param sName The data source name.
    */
   protected void loadDataSource(Element dataSourceElement, String sName)
   {
      DataSourceType type = m_metadata.getDataSourceTypeByElement(dataSourceElement);

      m_metadata.addDataSource(((XMLPersistenceMetadataLoader)m_helper.getClassInstance(type.getLoader()))
         .loadDataSource(dataSourceElement, sName, type, this));
   }
View Full Code Here

Examples of nexj.core.meta.persistence.DataSourceType

    * @return The data source type object.
    * @throws MetadataLookupException if the data source type does not exist.
    */
   public DataSourceType getDataSourceType(String sName)
   {
      DataSourceType dataSourceType = (DataSourceType) m_dataSourceTypeMap.get(sName);

      if (dataSourceType != null)
      {
         return dataSourceType;
      }
View Full Code Here
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.