Commit graph

494 commits

Author SHA1 Message Date
Shaan Sapra
43beff91a3 Avoid dropping Postgres schema
The postgres user needs to be an owner of the public schema or a
superuser in order to execute the schema.sql for database
initialization.

To avoid that, two changes are required:
 - use `CREATE TABLE IF NOT EXISTS` in order to idempotently create the
   necessary tables
 - handle conflicts when inserting duplicate data

This follows the pattern in use by the
src/main/resources/db/mysql/{data,schema.sql} files.

Authored-by: Shaan Sapra <shsapra@vmware.com>
2022-01-06 07:22:50 +00:00
Dave Syer
423a337543 Move Visit to owner package (it's aggregate root) 2022-01-05 09:39:26 +00:00
Dave Syer
58fe6298f8 Also remove VisitRepository
Rely on Hibernate to do lazy loading on visits.
2022-01-05 09:30:23 +00:00
Dave Syer
c9534421c8 Remove PetRepository and use Owner as aggregate
Owner is really the aggregate root in DDD terms and there is no
need to directly access the Pet entity.
2022-01-05 08:24:58 +00:00
Dave Syer
094d3021e9 Upgrade to Spring Boot 2.6.1 and fix Maven build 2021-12-16 11:39:30 +00:00
Fabian Muscariello
ce626da705 Add support for PostgreSQL
See #636
2021-12-07 16:55:01 +00:00
Dave Syer
eff7c9529f Use "date" type for date inputs
In 2021 we really should be using the browser's own date picker.
2021-12-06 14:33:58 +00:00
Dave Syer
67c8bf6a1f Fix ignores 2021-11-24 11:39:25 +00:00
Dave Syer
576c4eb58b Remove unused css files 2021-11-24 09:27:15 +00:00
Dave Syer
4ecc4c34c4 Make buttons look normal again 2021-11-24 09:14:14 +00:00
Dave Syer
ff2febe09f Put CSS generation in a Maven profile 2021-11-24 07:50:15 +00:00
Dave Syer
7ea283613d Alternative approach with libsass-maven-plugin 2021-11-24 07:48:14 +00:00
Dave Syer
4d4727fce1 No need for jquery 2021-11-24 07:48:14 +00:00
Dave Syer
1095a15f0e Convert to SCSS and Bootstrap 5 2021-11-24 07:48:14 +00:00
Dave Syer
4f2f8fab73 Remove redundant interface 2021-11-19 15:30:56 +00:00
Dave Syer
3eba970fff Fix page links 2021-11-19 13:34:47 +00:00
Dave Syer
8bfe9e68bf Tidy imports 2021-10-19 10:55:07 +01:00
Dave Syer
e57ef71e54 Ensure real database is used if mysql profile active 2021-10-05 13:36:50 +01:00
Dave Syer
e11a594ec2 Tidy up test 2021-10-01 15:09:25 +01:00
simrin051
8ad9c05f74 Add pagination for owners and vets lists in HTML
Fixes #91
2021-10-01 08:31:38 +01:00
Dave Syer
25ba1621a9
Add delimiter to list of pets 2021-09-14 17:33:24 +01:00
lsap
e7c879ed3a Update petclinic_db_setup_mysql.txt
Hey Team, thanks in advance!
2021-05-14 16:17:25 +01:00
Frank Migliorino
b91e21378c Fix docs for setting profiles
Add using -Dspring-boot.run.jvmArguments to the notes for how to set up using MySQL.
2021-05-14 13:01:26 +01:00
Cesarion Pshebytski
8b1ac6736e Updated user for mysql
Updated creation of user for mysql db. Previously lack of quotes resulted in creation of incorrect user (petclinic@% instead of just petclinic)
2020-11-06 11:13:25 +00:00
Rognetta
4953f87917 Update application-mysql.properties
Add some environment variables with defaults for the MySQL
credentials.

Closes #506
2020-06-25 17:12:30 +01:00
aleVeD
0390e85c25 adding new message in Spanish 2020-06-23 19:17:42 +01:00
Dave Syer
07b9d5aa45 Ensure fragment for menu items is not itself rendered
Formerly there was a "ghost" menu item with no text and no icon
because Thymeleaf had not been instructed to remove the fragment
definition. This change tidies that up and also removes the use of
the "path" variable, which Thymeleaf populates from the current
request context, and poses a potential security threat as a
result (if users type malicious characters in the URL).
2020-06-13 14:56:10 +01:00
Jay
410abc21f3 remove trailing slash 2020-06-13 14:06:34 +01:00
Stephane Nicoll
628862206b Switch actuator to standard path 2020-05-02 08:02:49 +02:00
Stephane Nicoll
8805eaa721 Disable open-in-view explicitly to remove warning on startup 2020-03-20 18:27:18 +01:00
Stephane Nicoll
c0847b7571 Add support for H2
Closes gh-584
2020-03-20 18:27:18 +01:00
Dave Syer
5c35771a20
Wrong name for user.sql script 2020-03-10 08:29:36 +00:00
Stephane Nicoll
1cc942a4ad Add nohttp check 2020-01-31 17:31:19 +01:00
Dave Syer
4e1f87407d Apply spring-format plugin 2020-01-03 11:22:05 +00:00
Dave Syer
5d57e0d5e2 Re-organise mysql scripts so the app runs without root access
It works better that way with test containers and in k8s.
2020-01-03 05:29:11 -05:00
Dave Syer
1561eb5506 Add proxyBeanMethods = false
It's slightly faster, and we don't need proxies in this app.
2019-11-20 10:21:33 +00:00
Dave Syer
2c98a681ca Uncomment sql initialization for mysql 2019-11-20 09:56:32 +00:00
Stephane Nicoll
253e6fde5f Polish "Migrate tests to JUnit 5"
See gh-360
2019-10-20 16:49:17 +02:00
Antoine Rey
ac69dbba23 Migrate tests to JUnit 5
See gh-360
2019-10-20 16:43:25 +02:00
Stephane Nicoll
ce7c3f93de Upgrade to Spring Boot 2.2.0.RELEASE 2019-10-20 16:40:04 +02:00
trisberg
e280d12144 Fix docs on mysql, use initialization-mode 2019-09-23 22:14:15 +02:00
Dave Syer
7ef045dac8 Make Pet.visits @Transient
In that way the Pet and Visit entities are more modular, and we
don't have to rely on a bit of a hack which is that Hibernate
happily maps Pet to its ID in the entity generation (but fails
if you do it at compile time).
2019-09-06 09:14:44 +01:00
Dave Syer
e157f200f8 Clarify the docs on mysql 2019-06-21 14:45:39 +01:00
Choonghee Lee
11d0ed4358 update table id attribute in ownersList.html
"vets" to "owners"
2019-06-05 13:41:27 +01:00
Stephane Nicoll
8919c7317b Polish "Cleanup tests by using more idiomatic assertj assertions"
See gh-418
2019-06-01 18:09:33 +02:00
Johannes Wengert
3f838c2df2 Cleanup tests by using more idiomatic assertj assertions
See gh-418
2019-06-01 18:03:52 +02:00
Stephane Nicoll
be24e0c15e Fix Apache license headers 2019-03-21 11:08:00 +01:00
Stephane Nicoll
765680c010 Polish "URL Cleanup"
Closes gh-397
2019-03-21 11:05:45 +01:00
Spring Operator
f4bed3cc17 URL Cleanup
See gh-397
2019-03-21 11:04:51 +01:00
Stephane Nicoll
0c59090c1a Polish 2019-03-20 11:13:21 +01:00
Dave Syer
827dc12325 Revert "Remove redundant component scan filter"
This reverts commit ab56724285.
2019-02-11 08:08:57 +00:00
Dave Syer
ab56724285 Remove redundant component scan filter
The @DataJpaTests creates all the repositories. There's no need
for a filter (and there aren't any matching @Service beans anyway).
2018-12-17 16:41:44 +00:00
Stephane Nicoll
895730caf9 Simplify build definition 2018-10-07 13:40:45 +02:00
Stephane Nicoll
893a18f595 Polish "Clarify cache configuration"
Closes gh-335
2018-07-13 16:57:48 +02:00
Jens Wilke
22ff39853d Clarify cache configuration
See gh-335
2018-07-13 16:52:34 +02:00
Stephane Nicoll
895422b8c8 Polish "Enable caching of static resources"
Closes gh-332
2018-07-10 09:10:03 +02:00
Antoine Rey
46babdad7c Enable caching of static resources
See gh-332
2018-07-10 08:57:21 +02:00
Stephane Nicoll
3c9afdc138 Polish 2018-07-10 08:55:27 +02:00
Stephane Nicoll
5ff057d90b Remove misleading production profile
Closes gh-333
2018-07-10 08:50:58 +02:00
Antoine Rey
e7eabca111 Adapt JMeter script to recent changes
Closes gh-330
2018-07-09 17:52:35 +02:00
Stephane Nicoll
4c22d010ea Polish "Use Java 8 LocalDate instead of java.util.Date"
Closes gh-328
2018-07-09 16:47:34 +02:00
Antoine Rey
c0748e3e82 Use Java 8 LocalDate instead of java.util.Date
See gh-328
2018-07-09 16:47:16 +02:00
Stephane Nicoll
5270246eb5 Polish 2018-06-04 10:54:27 +02:00
Stephane Nicoll
eebca43df8 Polish "Fix content negotiation for /vets"
Closes gh-326
2018-06-04 10:48:39 +02:00
Aiden-at-508687582768
8eb5074770 Fix content negotiation for /vets
See gh-326
2018-06-04 10:39:21 +02:00
trisberg
6905e38c1f Make MySQL configuration files/docs consistent
- use petclinic as the db name and root password

Fixes #322
2018-05-14 11:00:34 +01:00
Alan Drozd
d568bcaf0b Fix including template in layout fragment
Closes gh-319
2018-05-13 11:08:45 +02:00
Antoine Rey
d92a4218dd Add placeholder YYYY-MM-DD for date input field
Closes gh-303
2018-02-22 11:03:05 +01:00
Stephane Nicoll
106226929b Fix actuator exposure 2018-02-22 10:57:12 +01:00
Ray Tsang
c5abf45cbc Fix datasource initialization property
Closes gh-301
2018-02-22 10:35:34 +01:00
Dave Syer
cf35266336 Tidy up compiler warnings 2018-01-11 09:15:18 +00:00
Dave Syer
14ef611d70 Update to Spring Boot 2.0 snapshots 2018-01-09 17:50:14 +00:00
Dave Syer
c36452a2c3 Use leading / in app URL
Fixes gh-267
2017-11-03 14:17:56 +00:00
sunflower2014
e20b43b009 Update PetControllerTests.java
correct testProcessCreationFormHasErrors method's post url
2017-11-03 11:38:44 +00:00
Oscar Utbult
23f65ba7d0 Fix broken tests 2017-11-03 11:33:06 +00:00
Oscar Utbult
45da5a4d3b Fix date formatting 2017-11-03 11:33:06 +00:00
thetric
5b0f037d06 fix: make id 'lastName' in findOwners.html unique
previously the div.control-group and the containing input shared the same id
2017-11-03 11:32:19 +00:00
dastier
3e65dee237 fix button text in createOrUpdatePetForm.html in case of new pet (issue #252) 2017-11-03 11:31:53 +00:00
Antoine Rey
4be8ba2c43 Replace @RequestMapping by their corresponding shortcut @GetMapping and @PostMapping 2017-11-03 11:28:12 +00:00
Aditya Ketkar
05e891cec1 Removed redundant javadoc comments 2017-11-03 11:19:20 +00:00
Jeric Bryle Sy Dy
cdbfafe077 set pet to owner to avoid null owner when user gets an error on new pet page 2017-09-21 13:31:05 +01:00
Stephane Nicoll
75912a06c5 Polish contribution
Closes gh-229
2017-02-17 12:30:57 +01:00
Henri Tremblay
443d35eae2 Put Ehcache back 2017-02-17 06:22:26 -05:00
Dave Syer
63dadcc07f Make all entity fields private
Encapsulation is better that way (and tere is a getter for all of them
anyway).
2017-02-03 10:04:36 +00:00
Dave Syer
0a51540ad0 Fix serializability of Vet 2017-02-03 10:03:11 +00:00
Stephane Nicoll
be13722cc5 Polish 2017-02-03 08:37:02 +01:00
Stephane Nicoll
d2ec371496 Restore actuator access with Spring Boot 1.5 2017-02-03 08:36:48 +01:00
Dave Syer
80269539e2 Configure caching properly to avoid error in vets 2017-01-08 15:45:30 +00:00
Dave Syer
6da37c30d3 Use default cache configuration 2016-12-06 12:04:23 +00:00
Dave Syer
0c7db646ef Make mysql configuration more first class 2016-12-05 21:50:29 +00:00
Dave Syer
8b76a54814 Update mysql readme 2016-12-05 12:05:01 +00:00
Oscar Utbult
837483f1d0 Fix incorrect glyphicon name 2016-12-05 11:46:01 +00:00
Kristof Neirynck
61be1bac41 Fix #207 set pet owner when for has an error 2016-12-05 11:45:37 +00:00
Kristof Neirynck
ca2a66500f Correct view as xml url 2016-12-05 11:45:04 +00:00
Oscar Utbult
7dcae7cc86 Fix Javadoc error 2016-12-05 11:44:37 +00:00
Oscar Utbult
706c6fc647 Replace anonymous class with lambda 2016-12-05 11:44:14 +00:00
Dave Syer
131a588e09 Use wro4j instead of lesscss plugin
It's better maintained and it seems to provide more features
as well.
2016-11-17 10:51:36 +00:00
Dave Syer
83ff9a50e3 Modularize and migrate to aggregate-oriented domain
Vet, Owner, Visit. The Visit "aggregate" is a little artificial
but it demonstrates a useful point about not holding on to
references of "parent" (reference data) objects, i.e. the Visit has
an Integer petId, instead of a Pet field. In principle this app is
now almost ready to migrate to multiple services if anyone wanted
to do that.
2016-11-14 15:36:21 +00:00
Dave Syer
095b1a35d9 Move util class to test code 2016-11-10 17:45:54 +00:00
Dave Syer
e38a9feebe Convert to jar with thymeleaf 2016-11-10 17:22:02 +00:00
Antoine Rey
d69b89691c Fix #171 Jetty 9 support by removing Dandelion 2016-10-08 09:50:04 +02:00
Antoine Rey
f78ee5d76e Using the @CacheResult JSR-107 JCache annotation 2016-10-06 20:01:50 +02:00
Antoine Rey
b889abbe7f Replace SpringJUnit4ClassRunner by SpringRunner 2016-10-01 13:00:25 +02:00
Dapeng
a9b6565fcf Remove dependency with joda time to simplify the project dependencies 2016-09-25 18:25:33 +02:00
Antoine Rey
d189dbf4be Merge pull request #182 from snicoll/ehcache3
Upgrade to Ehcache 3 and Java config
2016-08-29 22:18:22 +02:00
Stephane Nicoll
a41b83a2fd Upgrade to Ehcache 3
I saw on twitter the reference of an article (in french):
http://javaetmoi.com/2016/08/migrer-vers-spring-boot/

That article concludes with something along the lines of  "Besides the
EhCache and Maven configuration, Petclinic does not hold a single line
of XML anymore".

Looking at the code, we can remove more XML if you want. This PR migrates
the cache infrastructure to EhCache 3 and JCache (JSR-107). This also
reduces the number of dependencies.
2016-08-29 18:48:12 +02:00
Antoine Rey
b96e1093d3 Add a Dockefile and configure the docker-maven-plugin 2016-08-29 18:47:47 +02:00
Antoine Rey
864580702f Remove unused properties 2016-08-23 19:45:00 +02:00
Antoine Rey
620141da5d Convert Controler's integration test to unit test 2016-08-19 18:29:53 +02:00
Antoine Rey
1080006218 Merging AbstractClinicServiceTests and ClinicServiceSpringDataJpaTests then using the Spring Boot @DataJpaTest annotation 2016-08-19 18:29:17 +02:00
Antoine Rey
2637f65b90 Upgrade to Spring Boot 1.4.0 2016-08-17 18:31:38 +02:00
AndrejGajdos
dbd1e54492 responsive menu fix
responsive menu fix - data-target attribute added
2016-08-16 19:09:35 +02:00
Antoine Rey
bbc1c8bb80 Add some missing trimDirectiveWhitespaces on JSPs 2016-06-30 19:07:54 +02:00
Antoine Rey
616386803c Revert "Make jar not war"
This reverts commit be048ae2ac.
2016-06-28 20:08:26 +02:00
Antoine Rey
be048ae2ac Make jar not war 2016-06-28 20:01:32 +02:00
Dapeng
eb6f9343ad migrate to webjars for frontend resource management
- petclinic.css is now auto generated, therefore it is put in the
ignore list
- vendor folder is removed in favour of webjars
- remove several maven dependencies which are already managed by spring
boot
- unfortunately, lesscss maven plugin does NOT support importing from
classpath, as a result, bootstrap is unpacked during process-resources
phase, we need need to find a better resolution
- remove bower integration
2016-06-28 18:02:53 +08:00
Dapeng
077f4eb105 simplify content negotiation setup
- remove custom xml view, use springboot builtin xml view
- remove oxm maven dependency
- remove json-simple maven dependency (seems not relevant anymore)
- update vetsXml test using xpath
2016-06-28 11:05:42 +08:00
Dapeng
aa8cc431eb simplify jsp layout management
abstract the page layout into “layout.tag”
2016-06-27 17:06:47 +08:00
Dapeng
beb46b2b3b support switching db init script at deployment 2016-06-27 12:35:37 +08:00
Antoine Rey
1f42b7615d #164 Set Dandelion active profile to "prod" when Spring production profile is enabled 2016-06-25 15:27:37 +02:00
Antoine Rey
4da41dbbda #164 Disable cache configuration for unit tests 2016-06-24 21:18:38 +02:00
Antoine Rey
e9f5f7b541 #164 Add main class required by the spring-boot-maven-plugin 2016-06-23 19:46:56 +02:00
Antoine Rey
a6e81a51a0 #164 Spring Boot version of Petclinic ready to deploy to an external web container (ie Tomcat) 2016-06-23 19:42:02 +02:00
Attilio
ca755be44a Improvements in VisitRepository.findByPetId implementation.
- In the Jdbc implementation: pets belonging to a visit were not added.
- In the Jpa implementation: query variable was wrong.
- Test case: AbstractClinicServiceTests.shouldFindVisitsByPetId()
2016-06-15 22:46:47 +02:00
Antoine Rey
817fabd9ea Fix #155 Fix logback + JMX memory leak on web application reload 2016-06-06 18:37:44 +02:00
Faisal Hameed
ad3d322fc6 Fising squid:S2970, squid:S1192, squid:S1488, squid:UselessParenthesesCheck 2016-05-13 14:59:46 +05:00
Antoine Rey
44b591f537 Using Spring Boot Dataflow UI graphic theme 2016-04-08 18:23:18 +02:00
Antoine Rey
e74b1bc160 #141 Configure Unicode and UTF-8 MySQL database for Chinese language 2016-04-05 22:05:41 +02:00
XIAO XI LIU
e6ca8a37a5 fix issue #144: remove redundant less-than sign 2016-04-05 07:04:33 +08:00
Antoine Rey
9a150fcc45 Merge pull request #131 from ameya-pandilwar/update-link-title
Update link navigation title to make it consistent
2016-04-04 08:36:55 +02:00
Antoine Rey
7dcf82af94 Fix #78 Migrate to Bootstrap 3.x 2016-04-04 08:13:51 +02:00
Antoine Rey
78a2532b33 Merge pull request #136 from lukasz-szewc/staticFiles-jquery-url-fix
Fixes #135 Fixed url for jquery-ui.
2016-03-08 18:23:41 +01:00
lukasz-szewc
87d025f854 fixed url for jquery-ui. There was typo "query" instaed of "jquery" and file cannot be loaded 2016-03-05 18:50:45 +01:00
kadinyazilimci
e7f68999bf owners search has been case insensitive 2016-02-25 09:36:20 +10:00
Ameya Pandilwar
6f349ec2eb Update link navigation title to make it consistent 2016-02-07 18:31:11 -05:00
thinksh
0504ec9fe3 Update petclinic_db_setup_mysql.txt
Correct initialization script file's name
2016-02-03 23:19:46 -05:00
Antoine Rey
2398c4d798 Merge pull request #119 from colinbut/master
Added test classes for Controllers plus tests for PetTypeFormatter
2016-01-30 14:26:26 +01:00
Antoine Rey
c65cfb6c11 moving from Webjars to Bower #83: renaming bower_components to vendor, update readme.md 2016-01-30 14:00:12 +01:00
IHABRITANE
540d31ed21 moving from Webjars to Bower #83 2016-01-25 17:22:41 +00:00
Colin But
845d31e8ed Added test class for Controllers plus a test for PetTypeFormatter 2015-11-20 13:56:44 +00:00
Tomas Repel
e00dfb3fe0 Using jodatime LocalDate instead of DateTime for visits 2015-11-02 10:51:04 +01:00
Antoine Rey
92de6557e1 Fix #111 For pet's birthday we are now using jodatime LocalDate instead of DateTime 2015-10-28 08:57:42 +01:00
Antoine Rey
4aa89ae4e2 Fix #110 owner and pet validators failed 2015-10-28 08:30:44 +01:00
Antoine Rey
dd552f4970 Fix #108 owner update 2015-10-26 18:35:40 +01:00
Antoine Rey
3bcf84543e #77 move Session scope attributes to the request scope instead 2015-10-23 08:42:27 +02:00
Antoine Rey
6a94d7e60a Remove uncessary _method=put parameter and enable the "POST new visit" HTTP request 2015-10-21 08:25:07 +02:00
Antoine Rey
5e11b4bbcc JMeter script from Julien Dubois 2015-10-20 18:59:55 +02:00
Tomas Repel
2270e2466b Removal of redundant comments 2015-10-16 15:04:17 +02:00
Antoine Rey
09ed33a5fc #96 Reformat code with EditorConfig 2015-10-16 09:33:28 +02:00
Antoine Rey
566fdac3f9 Merge pull request #99 from trepel/removalofputmethod
Removed HTTP PUT method - it is not supported in JSP 2.3
2015-10-14 08:30:22 +02:00