mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
use the old id generator as it's the one we were using before dropwizard
This commit is contained in:
@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
|
|
||||||
import org.eclipse.jetty.server.session.SessionHandler;
|
import org.eclipse.jetty.server.session.SessionHandler;
|
||||||
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
||||||
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
|
|
||||||
import com.commafeed.backend.feed.FeedRefreshTaskGiver;
|
import com.commafeed.backend.feed.FeedRefreshTaskGiver;
|
||||||
import com.commafeed.backend.feed.FeedRefreshUpdater;
|
import com.commafeed.backend.feed.FeedRefreshUpdater;
|
||||||
@@ -89,14 +90,18 @@ public class CommaFeedApplication extends Application<CommaFeedConfiguration> {
|
|||||||
FeedSubscription.class, User.class, UserRole.class, UserSettings.class) {
|
FeedSubscription.class, User.class, UserRole.class, UserSettings.class) {
|
||||||
@Override
|
@Override
|
||||||
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
|
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
|
||||||
return configuration.getDatabase();
|
DataSourceFactory factory = configuration.getDataSourceFactory();
|
||||||
|
|
||||||
|
// keep using old id generator for backward compatibility
|
||||||
|
factory.getProperties().put(AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "false");
|
||||||
|
return factory;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
bootstrap.addBundle(new MigrationsBundle<CommaFeedConfiguration>() {
|
bootstrap.addBundle(new MigrationsBundle<CommaFeedConfiguration>() {
|
||||||
@Override
|
@Override
|
||||||
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
|
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
|
||||||
return configuration.getDatabase();
|
return configuration.getDataSourceFactory();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class CommaFeedConfiguration extends Configuration {
|
|||||||
@Valid
|
@Valid
|
||||||
@NotNull
|
@NotNull
|
||||||
@JsonProperty("database")
|
@JsonProperty("database")
|
||||||
private DataSourceFactory database = new DataSourceFactory();
|
private DataSourceFactory dataSourceFactory = new DataSourceFactory();
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
Reference in New Issue
Block a user