});
}
private JPADataSource getDataSource(UIContext context)
{
JPADataSource dataSource = new JPADataSource();
dataSource.setDatabase(dbType.getValue());
dataSource.setJndiDataSource(dataSourceName.getValue());
dataSource.setDatabaseURL(databaseURL.getValue());
dataSource.setUsername(username.getValue());
dataSource.setPassword(password.getValue());
Map<Object, Object> attributeMap = context.getAttributeMap();
dataSource.setProvider((PersistenceProvider) attributeMap.get(PersistenceProvider.class));
dataSource.setContainer((PersistenceContainer) attributeMap.get(PersistenceContainer.class));
return dataSource;
}