@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; }
@Override public void validate(JPADataSource dataSource) throws Exception { if (Strings.isNullOrEmpty(dataSource.getJndiDataSource())) { throw new RuntimeException("Must specify a JNDI data-source."); } }