/*
 * Copyright 2012-2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.autoconfigure.data;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;

/**
 * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's JPA Repositories.
 * 
 * @author Phillip Webb
 * @see EnableJpaRepositories
 */
@Configuration
@ConditionalOnClass(JpaRepository.class)
@ConditionalOnMissingBean(JpaRepositoryFactoryBean.class)
@Import(JpaRepositoriesAutoConfigureRegistrar.class)
public class JpaRepositoriesAutoConfiguration {

}

@@ -680,69 +680,240 @@
 ort 
-org.springframework.boot.autoconfigure.EnableAutoConfiguratio
+javax.sql.DataSource;%0A%0Aimport org.springframework.boot.autoconfigure.AutoConfigureAfter;%0Aimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;%0Aimport org.springframework.boot.autoconfigure.condition.ConditionalOnBea
 n;%0Ai
@@ -1065,24 +1065,104 @@
 issingBean;%0A
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;%0A
 import org.s
@@ -1656,16 +1656,53 @@
 uration%0A
+@ConditionalOnBean(DataSource.class)%0A
 @Conditi
@@ -1792,16 +1792,16 @@
 .class)%0A
-
 @Import(
@@ -1845,16 +1845,71 @@
 .class)%0A
+@AutoConfigureAfter(DataSourceAutoConfiguration.class)%0A
 public c

Make data-jpa conditional on DataSource bean