Commit graph

395 commits

Author SHA1 Message Date
YiXuan Ding
40a41375e6 Add new test file
-<modify>: remove `@Transactional`.
-<add>: create unit-test file related to `PetValidator`.
-<refactor>: move pet objects initialization to `@BeforeEach` setup.
2024-11-28 09:52:29 +00:00
YiXuan Ding
214a8fb87f <fix>: rename the DI variable name in constructor. 2024-11-28 09:51:42 +00:00
Patrick Baumgartner
a0ba075bd8 Futher updates for Spring Boot 3.4 2024-11-27 11:24:18 +00:00
Dave Syer
91f55a4f71 Versionless webjars (again)
Spring Boot 3.4 supports the webjars-locator-lite which in turn
supports native images, so we are back to versionless URLs for
webjars assets in templates.
2024-11-27 08:32:35 +00:00
YiXuan Ding
1cad4124b7 Refactor code logic
<refactor>: remove useless logic cod.
<refactor>: detele useless annotation which is provided by Jpa.
<refactor>: refactor implement of `findByLastName`, use Jpa to simplify query.
2024-11-11 17:55:34 +00:00
YiXuan Ding
668629d5bd refactor OwnerRepository:
-<replace>: use `JpaRepository` to replace `Repository` in `OwnerRepository` class.
-<remove1>: remove `save()` method. JpaRepository provides it by default.
-<remove2>: remove `@Query` because in `Owner` class, the `@OneToMany` annotiation achieved `fetch` in query.
-<refactor1>: use `Optional<Owner>` to recieve the result from `findById()`, and if is null, throw `IllegalArugmentExpection`.
-<refactor2>: achieve the assert to judge return value in tests.
-<add>: add name to `@author` tag.
2024-11-10 09:14:42 +00:00
YiXuan Ding
50866def72 Refactor the logic and add unit test
-<add>: add `@NotBlank` validation to pet's name.
-<refactor>: delete useless code and add unit test to check duplicate Pet name validation logic.
-<modify>: add `Id` to pet in unit test.
-<refactor>: classify unit test.

<modify>: adjust code format.
2024-11-07 22:34:46 +08:00
YiXuan Ding
14af47d4e5 Refactor:
- <optimize>: delete logic `add owner to model` because of the comment `@ModelAttribute("owner")`.
- <fix>: add logical judgment in ordet to avoid `owner` from `form` and `ownerId` from `url` mismatch.
2024-11-06 18:46:58 +00:00
YiXuan Ding
fdc40a7048 Fix harmless bugs.
- <fix>: use `equals` to replace `==` to compare `Integer` variable.
- <delete>: remove redundant 'toLowerCase()' method and simplify pet lookup logic.
- <update>: rewrite method `getName()` comments.
2024-11-05 16:31:25 +00:00
João Bertholino
dff45cf70c fix: Temporarily removing accentuation from messages. 2024-11-05 08:27:02 +00:00
João Bertholino
bbb237928f feat: Adds support for the Portuguese language. 2024-10-20 17:25:23 +01:00
ruabooe
912de1648e feat: add russian 2024-10-20 12:08:50 +01:00
Mousa Al Bateh
ae1bb8228c Minor code changes are the following:
-Removed unused variables from few files.
-Added null assertions in some tests.
-Removed unnecessary throw exceptions.
2024-10-10 07:50:06 +01:00
Patrick Baumgartner
f8001e0add Change chmod like other files 2024-09-30 21:41:01 +01:00
ghost
2daa3993ee Removed unused imports
Made some variables as final
2024-09-24 20:37:48 +01:00
Sébastien Deleuze
d90e284621 Disable JPA Open Session In View
With the current codebase, it does not seems to be
needed anymore, so we disable it to provide better
performances.
2024-09-24 16:05:18 +01:00
Patrick Baumgartner
39cc7e160e Upgrade Dependencies 2024-05-25 17:00:35 +01:00
Pedro Chevallier
405cdc635b Add user friendly error message 2024-05-16 17:59:59 +01:00
minsungoh
c7bc8b1ae6 fix typo in confirmation message 2024-05-16 17:57:32 +01:00
akan.tileubergenov
bf3bc29e56 Fix postgres data 2024-05-16 14:09:10 +01:00
Dave Syer
836d111e99 Fix formatting 2024-01-31 21:54:55 +00:00
shadab-stack
2fe96130c0 Confirmation messages displayed for 'Add, edit, or update' actions 2024-01-31 21:54:55 +00:00
Dave Syer
cdd925d664 Small optimization for empty petId 2024-01-11 13:18:33 +00:00
Patrick Baumgartner
de0e3663c0 Update dependency 2023-11-26 09:08:45 +00:00
Dave Syer
d11d6e8e40 Remove unnecessary model change 2023-09-12 12:11:33 +01:00
anthony-park
18266fec8b feat: Add a Korean message file to support at least one non-European language
This commit introduces a new Korean message file to the project. With this addition, the project now supports messages in languages other than European languages.

Resolves: #1299
2023-09-12 11:31:20 +01:00
evga7
4926e29270 Change validation annotations and whitespace handling 2023-08-24 14:38:46 -07:00
bijomutta
0a529015bc handling Null pointer Exception on OwnerID 2023-07-14 10:27:01 +01:00
bijomutta
3a6127557d Adding pet name validation on edit Pet 2023-07-13 13:05:34 +01:00
bijomutta
3be289517d Add birthdate validation 2023-07-10 15:00:26 +01:00
Dave Syer
c231682c2d Tidy up native tests 2023-07-07 10:25:30 +01:00
Seunghyeon Ji
ca2d8dbc09 Update VetController.java
Erasing unnecessary 1 line
2023-07-05 11:34:44 +01:00
Patrick Baumgartner
0d9e882e54
Upgrade for Spring Boot 3.1 (#1253)
* Upgrade for Spring Boot 3.1

* Remove 'encoding' because of Maven WARNING

* Extracting logo SVG into file

* Making logo src context-path aware

* Remove unused image
2023-05-26 18:56:00 +01:00
jcw1031
8a5a14e88a Owner class addVisit() method return type void 2023-05-09 10:35:06 +01:00
Andrii Abramov
6e71aaa44c Fix typo in OwnerRepository.java 2023-04-13 14:11:33 +01:00
ross
b94d30626f Fix typo
fix typo of org.springframework.samples.petclinic.owner.Owner.getPet(java.lang.String) annotation.
2023-04-13 14:10:05 +01:00
Patrick Baumgartner
0962ed7e8f Updating dependencies and docker containers to current versions
See #1157
2023-03-10 14:00:30 +00:00
Duncan Casteleyn
cc4667122d Resource bundle not included in native image 2023-03-10 08:10:28 +00:00
Dave Syer
f2d9c9b63f Remove unnecessary native hint 2023-02-24 09:23:35 +00:00
Dave Syer
b298af380d Remove unnecessary model attribute 2023-02-21 11:46:22 +00:00
Sébastien Deleuze
f53e0d098e Additional setup to support native image creation.
- Switch to Caffeine for caching since it is supported on native unlike Ehcache
 - Use latest metadata repository 0.2.3 (will be the default with Native Build Tools 0.9.15)
 - Registers resource hints for WebJars and db resource directory
2022-10-25 21:37:25 +02:00
Dave Syer
1315cf6e1f Migrate to Spring Boot 3 2022-10-25 21:34:03 +02:00
Oliver Drotbohm
9ecdc1111e Polish Thymeleaf templates.
Make sure we use the suggested fragment inclusion syntax. Use th:insert instead of th:include. Use simpler URI path segment templating to avoid duplication of expressions.

Avoid trailing slashes in URIs creates as upcoming Spring Boot versions will not map the trailing slash flavors of defined URI mappings.
2022-10-25 21:27:58 +02:00
Sébastien Deleuze
a5cbb8505a
Use WebJars versioned URLs (#1099)
In order to improve efficiency (see spring-projects/spring-framework#27619)
and allow native image compatibility, this commit uses WebJars versioned URLs
which are supported out of the box on Spring Boot via /META-INF/resources
default resource location configuration, removing the need to use
webjars-locator-core dependency and WebJarsResourceResolver.

I have been able to measure a consistent 5% startup time improvement on
the JVM with that simple change on my local machine.
2022-10-16 16:12:23 +01:00
Kiyeon Cho
f48227aea0
Readability improvements & Use stream instread of forEach (#1055)
* Use stream instead of forEach on find PetType logic of parse()

* Improve controllers readability

* Rollback stream instead of for-each
2022-09-24 06:40:31 +01:00
Shweta Tyagi
c5763046dd Removed unnecessary semicolons (#998) 2022-08-22 10:59:52 +00:00
kvaithin
80d03f3cef 985 remove lastName method param from OwnerController 2022-06-15 16:15:15 +00:00
Tagir Valeev
2a12048e78 Update javadoc: it incorrectly said to return 'true' 2022-06-15 17:12:59 +01:00
Dave Syer
0c1fa8e8e2 Update name of deprecated config property 2022-05-19 14:08:07 +00:00
Dave Syer
1db99dbb58 Update to Spring Boot 2.7.0 2022-05-19 14:07:16 +00:00