congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DataSourceModel
Code IndexAdd Tabnine to your IDE (free)

How to use
DataSourceModel
in
org.jboss.windup.rules.apps.javaee.model

Best Java code snippets using org.jboss.windup.rules.apps.javaee.model.DataSourceModel (Showing top 14 results out of 315)

origin: org.jboss.windup.rules.apps/windup-rules-java-ee

if (StringUtils.equals("Oracle", dataSource.getDatabaseTypeName()))
  linkable.addLink(eap6OracleLink);
else if (StringUtils.equals("MySQL", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("Postgres", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("SqlServer", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("DB2", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("Sybase", dataSource.getDatabaseTypeName()))
origin: windup/windup

  private void createDataSourceModel(GraphRewrite event, EvaluationContext context, XmlFileModel xmlFileModel)
  {
    GraphContext graphContext = event.getGraphContext();
    DataSourceService dataSourceService = new DataSourceService(graphContext);

    // check the root XML node.
    Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), xmlFileModel.getProjectModel());

    Document doc = new XmlFileService(graphContext).loadDocumentQuiet(event, context, xmlFileModel);

    for (String tagName : Arrays.asList(SINGLE_DATASOURCE_TAG, SINGLE_DATASOURCE_XA_TAG))
    {
      for (Element element : $(doc).find(tagName).get())
      {
        DataSourceModel dataSourceModel = dataSourceService.create();

        boolean isXa = tagName.equals(SINGLE_DATASOURCE_XA_TAG);
        dataSourceModel.setName(element.getAttribute("pool-name"));
        dataSourceModel.setJndiLocation(element.getAttribute("jndi-name"));
        dataSourceModel.setApplications(applications);
        dataSourceModel.setXa(isXa);
      }
    }
  }
}
origin: org.jboss.windup.rules.apps/windup-rules-java-ee

if (StringUtils.isNotBlank(resolvedType))
  dataSource.setDatabaseTypeName(resolvedType);
if (StringUtils.isNotBlank(resolvedType))
  dataSource.setDatabaseTypeName(resolvedType);
origin: org.jboss.windup.rules.apps/windup-rules-java-ee

if (StringUtils.isNotBlank(resolvedType))
  dataSource.setDatabaseTypeName(resolvedType);
dataSource.setXa(true);
origin: windup/windup

  /**
   * Create unique; if existing convert an existing {@link DataSourceModel} if one exists.
   */
  public synchronized DataSourceModel createUnique(Set<ProjectModel> applications, String dataSourceName, String jndiName)
  {
    JNDIResourceModel jndiResourceModel = new JNDIResourceService(getGraphContext()).createUnique(applications, jndiName);
    final DataSourceModel dataSourceModel;
    if (jndiResourceModel instanceof DataSourceModel)
    {
      dataSourceModel = (DataSourceModel) jndiResourceModel;
    }
    else
    {
      dataSourceModel = addTypeToModel(jndiResourceModel);
    }
    dataSourceModel.setName(dataSourceName);
    return dataSourceModel;
  }
}
origin: windup/windup

if (StringUtils.isNotBlank(resolvedType))
  dataSource.setDatabaseTypeName(resolvedType);
dataSource.setXa(true);
origin: org.jboss.windup.rules.apps/windup-rules-java-ee

  /**
   * Create unique; if existing convert an existing {@link DataSourceModel} if one exists.
   */
  public synchronized DataSourceModel createUnique(Set<ProjectModel> applications, String dataSourceName, String jndiName)
  {
    JNDIResourceModel jndiResourceModel = new JNDIResourceService(getGraphContext()).createUnique(applications, jndiName);
    final DataSourceModel dataSourceModel;
    if (jndiResourceModel instanceof DataSourceModel)
    {
      dataSourceModel = (DataSourceModel) jndiResourceModel;
    }
    else
    {
      dataSourceModel = addTypeToModel(jndiResourceModel);
    }
    dataSourceModel.setName(dataSourceName);
    return dataSourceModel;
  }
}
origin: org.jboss.windup.rules.apps/windup-rules-java-ee

  private void createDataSourceModel(GraphRewrite event, EvaluationContext context, XmlFileModel xmlFileModel)
  {
    GraphContext graphContext = event.getGraphContext();
    DataSourceService dataSourceService = new DataSourceService(graphContext);

    // check the root XML node.
    Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), xmlFileModel.getProjectModel());

    Document doc = new XmlFileService(graphContext).loadDocumentQuiet(event, context, xmlFileModel);

    for (String tagName : Arrays.asList(SINGLE_DATASOURCE_TAG, SINGLE_DATASOURCE_XA_TAG))
    {
      for (Element element : $(doc).find(tagName).get())
      {
        DataSourceModel dataSourceModel = dataSourceService.create();

        boolean isXa = tagName.equals(SINGLE_DATASOURCE_XA_TAG);
        dataSourceModel.setName(element.getAttribute("pool-name"));
        dataSourceModel.setJndiLocation(element.getAttribute("jndi-name"));
        dataSourceModel.setApplications(applications);
        dataSourceModel.setXa(isXa);
      }
    }
  }
}
origin: org.jboss.windup.rules.apps/windup-rules-java-ee

dataSource.setXa(true);
persistenceUnitModel.addDataSource(dataSource);
for (DataSourceModel datasource : persistenceUnitModel.getDataSources())
  datasource.setDatabaseTypeName(HibernateDialectDataSourceTypeResolver.resolveDataSourceTypeFromDialect(dialect));
origin: windup/windup

if (StringUtils.isNotBlank(resolvedType))
  dataSource.setDatabaseTypeName(resolvedType);
if (StringUtils.isNotBlank(resolvedType))
  dataSource.setDatabaseTypeName(resolvedType);
origin: windup/windup

if (StringUtils.equals("Oracle", dataSource.getDatabaseTypeName()))
  linkable.addLink(eap6OracleLink);
else if (StringUtils.equals("MySQL", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("Postgres", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("SqlServer", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("DB2", dataSource.getDatabaseTypeName()))
  linkable.addLink(lnk);
else if (StringUtils.equals("Sybase", dataSource.getDatabaseTypeName()))
origin: org.jboss.windup.rules.apps/windup-rules-java-ee

private void extractDataSourceMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference)
{
  javaTypeReference.getFile().setGenerateSourceReport(true);
  JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference;
  JavaClassModel datasourceClass = getJavaClass(javaTypeReference);
  String dataSourceName = getAnnotationLiteralValue(annotationTypeReference, "name");
  if (Strings.isNullOrEmpty(dataSourceName))
  {
    dataSourceName = datasourceClass.getClassName();
  }
  String isXaString = getAnnotationLiteralValue(annotationTypeReference, "transactional");
  boolean isXa = isXaString == null || Boolean.getBoolean(isXaString);
  Service<DataSourceModel> dataSourceService = new GraphService<>(event.getGraphContext(), DataSourceModel.class);
  DataSourceModel dataSourceModel = dataSourceService.create();
  Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), javaTypeReference.getFile().getProjectModel());
  dataSourceModel.setApplications(applications);
  dataSourceModel.setName(dataSourceName);
  dataSourceModel.setXa(isXa);
  dataSourceModel.setJndiLocation(dataSourceName);
}
origin: windup/windup

dataSource.setXa(true);
persistenceUnitModel.addDataSource(dataSource);
for (DataSourceModel datasource : persistenceUnitModel.getDataSources())
  datasource.setDatabaseTypeName(HibernateDialectDataSourceTypeResolver.resolveDataSourceTypeFromDialect(dialect));
origin: windup/windup

private void extractDataSourceMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference)
{
  javaTypeReference.getFile().setGenerateSourceReport(true);
  JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference;
  JavaClassModel datasourceClass = getJavaClass(javaTypeReference);
  String dataSourceName = getAnnotationLiteralValue(annotationTypeReference, "name");
  if (Strings.isNullOrEmpty(dataSourceName))
  {
    dataSourceName = datasourceClass.getClassName();
  }
  String isXaString = getAnnotationLiteralValue(annotationTypeReference, "transactional");
  boolean isXa = isXaString == null || Boolean.getBoolean(isXaString);
  Service<DataSourceModel> dataSourceService = new GraphService<>(event.getGraphContext(), DataSourceModel.class);
  DataSourceModel dataSourceModel = dataSourceService.create();
  Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), javaTypeReference.getFile().getProjectModel());
  dataSourceModel.setApplications(applications);
  dataSourceModel.setName(dataSourceName);
  dataSourceModel.setXa(isXa);
  dataSourceModel.setJndiLocation(dataSourceName);
}
org.jboss.windup.rules.apps.javaee.modelDataSourceModel

Javadoc

Represents a data source within the application.

Most used methods

  • getDatabaseTypeName
    Contains database type name.
  • setApplications
  • setDatabaseTypeName
    Contains database type name.
  • setJndiLocation
  • setName
    Name of the datasource.
  • setXa
    Defines whether it is an XA datasource.

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • getSystemService (Context)
  • setContentView (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now