Commit 7d739dfaaea4b41f7c11a86b8ea6cef91fa59610
Committed by
Andrew Shvayka
1 parent
f81c688c
fix PsqlTsDao annotation & sql-ttl services
Showing
4 changed files
with
6 additions
and
3 deletions
@@ -27,7 +27,6 @@ import java.sql.Statement; | @@ -27,7 +27,6 @@ import java.sql.Statement; | ||
27 | 27 | ||
28 | 28 | ||
29 | @Slf4j | 29 | @Slf4j |
30 | -@PsqlDao | ||
31 | public abstract class AbstractCleanUpService { | 30 | public abstract class AbstractCleanUpService { |
32 | 31 | ||
33 | @Value("${spring.datasource.url}") | 32 | @Value("${spring.datasource.url}") |
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value; | @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value; | ||
20 | import org.springframework.scheduling.annotation.Scheduled; | 20 | import org.springframework.scheduling.annotation.Scheduled; |
21 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
22 | import org.thingsboard.server.dao.util.PsqlDao; | 22 | import org.thingsboard.server.dao.util.PsqlDao; |
23 | +import org.thingsboard.server.dao.util.SqlDao; | ||
23 | import org.thingsboard.server.service.ttl.AbstractCleanUpService; | 24 | import org.thingsboard.server.service.ttl.AbstractCleanUpService; |
24 | 25 | ||
25 | import java.sql.Connection; | 26 | import java.sql.Connection; |
@@ -27,6 +28,7 @@ import java.sql.DriverManager; | @@ -27,6 +28,7 @@ import java.sql.DriverManager; | ||
27 | import java.sql.SQLException; | 28 | import java.sql.SQLException; |
28 | 29 | ||
29 | @PsqlDao | 30 | @PsqlDao |
31 | +@SqlDao | ||
30 | @Slf4j | 32 | @Slf4j |
31 | @Service | 33 | @Service |
32 | public class EventsCleanUpService extends AbstractCleanUpService { | 34 | public class EventsCleanUpService extends AbstractCleanUpService { |
@@ -18,14 +18,12 @@ package org.thingsboard.server.service.ttl.timeseries; | @@ -18,14 +18,12 @@ package org.thingsboard.server.service.ttl.timeseries; | ||
18 | import lombok.extern.slf4j.Slf4j; | 18 | import lombok.extern.slf4j.Slf4j; |
19 | import org.springframework.beans.factory.annotation.Value; | 19 | import org.springframework.beans.factory.annotation.Value; |
20 | import org.springframework.scheduling.annotation.Scheduled; | 20 | import org.springframework.scheduling.annotation.Scheduled; |
21 | -import org.thingsboard.server.dao.util.PsqlTsAnyDao; | ||
22 | import org.thingsboard.server.service.ttl.AbstractCleanUpService; | 21 | import org.thingsboard.server.service.ttl.AbstractCleanUpService; |
23 | 22 | ||
24 | import java.sql.Connection; | 23 | import java.sql.Connection; |
25 | import java.sql.DriverManager; | 24 | import java.sql.DriverManager; |
26 | import java.sql.SQLException; | 25 | import java.sql.SQLException; |
27 | 26 | ||
28 | -@PsqlTsAnyDao | ||
29 | @Slf4j | 27 | @Slf4j |
30 | public abstract class AbstractTimeseriesCleanUpService extends AbstractCleanUpService { | 28 | public abstract class AbstractTimeseriesCleanUpService extends AbstractCleanUpService { |
31 | 29 |
@@ -17,5 +17,9 @@ package org.thingsboard.server.dao.util; | @@ -17,5 +17,9 @@ package org.thingsboard.server.dao.util; | ||
17 | 17 | ||
18 | import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | 18 | import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
19 | 19 | ||
20 | +import java.lang.annotation.Retention; | ||
21 | +import java.lang.annotation.RetentionPolicy; | ||
22 | + | ||
23 | +@Retention(RetentionPolicy.RUNTIME) | ||
20 | @ConditionalOnExpression("'${database.ts.type}'=='sql' && '${spring.jpa.database-platform}'=='org.hibernate.dialect.PostgreSQLDialect'") | 24 | @ConditionalOnExpression("'${database.ts.type}'=='sql' && '${spring.jpa.database-platform}'=='org.hibernate.dialect.PostgreSQLDialect'") |
21 | public @interface PsqlTsDao { } | 25 | public @interface PsqlTsDao { } |