Exemple #1
0
  @Override
  @SuppressWarnings("rawtypes")
  public PersistenceUnitCommon setupConnection(
      PersistenceUnitCommon unit, JPADataSource dataSource) {
    unit.transactionType("RESOURCE_LOCAL");
    if (dataSource.hasJdbcConnectionInfo()) {
      // ShellMessages.info(writer, "Ignoring jdbc connection info [" +
      // dataSource.getJdbcConnectionInfo() + "]");
    }

    unit.nonJtaDataSource(dataSource.getJndiDataSource());
    unit.jtaDataSource(null);

    return unit;
  }
Exemple #2
0
 @Override
 public void validate(JPADataSource dataSource) throws Exception {
   if (Strings.isNullOrEmpty(dataSource.getJndiDataSource())) {
     throw new RuntimeException("Must specify a JNDI data-source.");
   }
 }