Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced DB plugin, de-coupled GUI from rapidoid-db.
- Loading branch information
1 parent
fb7f393
commit 7e918ce
Showing
11 changed files
with
105 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
rapidoid-app/src/main/java/org/rapidoid/app/TxInterceptor.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
rapidoid-plugins/src/main/java/org/rapidoid/plugins/DbPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.rapidoid.plugins; | ||
|
||
/* | ||
* #%L | ||
* rapidoid-plugins | ||
* %% | ||
* Copyright (C) 2014 - 2015 Nikolche Mihajlovski | ||
* %% | ||
* 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. | ||
* #L% | ||
*/ | ||
|
||
import java.util.List; | ||
|
||
import org.rapidoid.annotation.Authors; | ||
import org.rapidoid.annotation.Since; | ||
import org.rapidoid.lambda.Callback; | ||
|
||
@Authors("Nikolche Mihajlovski") | ||
@Since("3.0.0") | ||
public interface DbPlugin { | ||
|
||
<T> T get(long id); | ||
|
||
<T> T getIfExists(long id); | ||
|
||
<T> List<T> getAll(Class<T> clazz); | ||
|
||
void update(Object entity); | ||
|
||
void insert(Object entity); | ||
|
||
void delete(long id); | ||
|
||
<T> List<T> find(String query); | ||
|
||
void transaction(Runnable tx, boolean readonly, Callback<Void> callback); | ||
|
||
/** | ||
* WARNING: Deletes ALL data in the database! Use with care! | ||
*/ | ||
void deleteAllData(); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
rapidoid-plugins/src/main/java/org/rapidoid/plugins/Plugins.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.rapidoid.plugins; | ||
|
||
import org.rapidoid.annotation.Authors; | ||
import org.rapidoid.annotation.Since; | ||
|
||
/* | ||
* #%L | ||
* rapidoid-plugins | ||
* %% | ||
* Copyright (C) 2014 - 2015 Nikolche Mihajlovski | ||
* %% | ||
* 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. | ||
* #L% | ||
*/ | ||
|
||
@Authors("Nikolche Mihajlovski") | ||
@Since("3.0.0") | ||
public class Plugins { | ||
|
||
public static DbPlugin db() { | ||
return null; | ||
} | ||
|
||
|
||
} |