Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
m4102_tp3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Desmons
m4102_tp3
Commits
378ff06c
Commit
378ff06c
authored
5 years ago
by
Yvan Peter
Browse files
Options
Downloads
Patches
Plain Diff
Changement du chemin de la base pour éviter les conflits de noms
parent
9f47b58e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/ulille/iut/pizzaland/BDDFactory.java
+9
-8
9 additions, 8 deletions
src/main/java/fr/ulille/iut/pizzaland/BDDFactory.java
with
9 additions
and
8 deletions
src/main/java/fr/ulille/iut/pizzaland/BDDFactory.java
+
9
−
8
View file @
378ff06c
...
...
@@ -10,12 +10,15 @@ import org.jdbi.v3.sqlobject.SqlObjectPlugin;
public
class
BDDFactory
{
private
static
Jdbi
jdbi
=
null
;
private
static
String
dbPath
=
"jdbc:sqlite:"
+
System
.
getProperty
(
"java.io.tmpdir"
)
+
System
.
getProperty
(
"file.separator"
)
+
System
.
getProperty
(
"user.name"
)
+
"_"
;
public
static
Jdbi
getJdbi
()
{
if
(
jdbi
==
null
)
{
jdbi
=
Jdbi
.
create
(
"jdbc:sqlite:"
+
System
.
getProperty
(
"java.io.tmpdir"
)
+
System
.
getProperty
(
"file.separator"
)
+
"pizza.db"
)
jdbi
=
Jdbi
.
create
(
dbPath
+
"pizza.db"
)
.
installPlugin
(
new
SQLitePlugin
())
.
installPlugin
(
new
SqlObjectPlugin
());
}
...
...
@@ -24,9 +27,7 @@ public class BDDFactory {
public
static
void
setJdbiForTests
()
{
if
(
jdbi
==
null
)
{
jdbi
=
Jdbi
.
create
(
"jdbc:sqlite:"
+
System
.
getProperty
(
"java.io.tmpdir"
)
+
System
.
getProperty
(
"file.separator"
)
+
"pizza_test.db"
)
jdbi
=
Jdbi
.
create
(
dbPath
+
"pizza_test.db"
)
.
installPlugin
(
new
SQLitePlugin
())
.
installPlugin
(
new
SqlObjectPlugin
());
}
...
...
@@ -43,4 +44,4 @@ public class BDDFactory {
public
static
<
T
>
T
buildDao
(
Class
<
T
>
daoClass
)
{
return
getJdbi
().
onDemand
(
daoClass
);
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment