Чашечка Java
前往频道在 Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
显示更多8 295
订阅者
+324 小时
+127 天
-4930 天
帖子存档
8 290
CompletableFuture in Java with Example - Tutorial
Hello friends, we meet again today on our journey to Java. So I hope you guys are excited about our lesson. Let me ask you guys one thing before we proceed. Do you guys ever wonder about the future?...
Read: http://www.java67.com/2022/02/completablefuture-in-java-with-example.html
13 2月 2022, 05:57
8 290
Top Java Blogs Weekly: Best of 8/2022
Best of Top Java Blogs, year 2022, week 8
Read: https://www.topjavablogs.com/news/best-of-8-2022
13 2月 2022, 01:02
8 290
[Solved] Caused by: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number in Java and Oracle
Hello guys, if you are getting below error in your Java program and wondering how to solve this or just stuck then you have come to the right place. In this article, I will explain to you what causes...
Read: http://www.java67.com/2021/06/caused-by-java-01722-invalisqlsqlsyntaxerrorexception-ORA-01722-invalid-number.html
13 2月 2022, 00:04
8 290
How to Parse JSON in Java Object using Jackson - Example Tutorial
Hello guys, if you are wondering how to parse JSON in Java then don't worry, there are many options. In the last article, I have shown you 3 ways to parse JSON in Java in this example, You will...
Read: http://www.java67.com/2015/02/how-to-parse-json-tofrom-java-object.html
12 2月 2022, 08:23
8 290
12 2月 2022, 06:02
14 2月 2022, ~06:03
8 290
Spring Batch 5.0 M1 released
On behalf of the team and everyone who contributed, I am pleased to announce that the first milestone release of Spring Batch 5.0 is available now from https://repo.spring.io/milestone. This first milestone includes a number of major changes such as requiring Java 17+, migrating to Jakarta EE 9 APIs as well as upgrading our dependencies across the portfolio to major versions such as Spring Framework 6.0. For a complete list of changes, please check the change log.
We also took the opportunity of this major version to remove deprecated APIs and fix some issues that require non backward compatible changes. The migration guide contains more details about these changes and provides the upgrade instructions.
As we continue our work on Spring Batch 5, we look forward to your feedback on this first milestone!
Spring Batch Home | Source on GitHub
Читать: https://spring.io/blog/2022/01/19/spring-batch-5-0-m1-released
11 2月 2022, 11:25
11 2月 2022, ~11:25
8 290
Spring Data JDBC - How Can I Do a Partial Update of an Aggregate Root?
This is the fourth article of a series about how to tackle various challenges you might encounter when using Spring Data JDBC.
The series consists of:
1.
Spring Data JDBC - How to Use Custom ID Generation.
2.
Spring Data JDBC - How Do I Make Bidirectional Relationships?
3.
Spring Data JDBC - How Do I Implement Caching?
4.
Spring Data JDBC - How Can I Do a Partial Update of an Aggregate Root? (this article)
If you are new to Spring Data JDBC, you should start by reading introduction and this article, which explains the relevance of aggregates in the context of Spring Data JDBC. Trust me. It is important.
Spring Data JDBC is built around the idea of aggregates and repositories.
Repositories are collection-like objects that find, load, save, and delete aggregates.
Aggregates are clusters of objects that have a tight relationship and are internally consistent whenever program control is outside their methods.
As such, aggregates also get loaded and persisted together in one atomic operation.
However, Spring Data JDBC doesn’t keep track of how your aggregates change.
Therefore, Spring Data JDBCs algorithm for persisting an aggregate minimizes the assumptions made about the database state.
This is costly if your aggregate contains a collection of entities.
For an example to show what happens, we once again turn to Minions.
This Minion has a Set of Toys.
class Minion {
@Id Long id;
String name;
Color color = Color.YELLOW;
Set<toy toys = new HashSet();
@Version int version;
Minion(String name) {
this.name = name;
}
@PersistenceConstructor
private Minion(Long id, String name, Collection<toy toys, int version) {
this.id = id;
this.name = name;
this.toys.addAll(toys);
this.version = version;
}
Minion addToy(Toy toy) {
toys.add(toy);
return this;
}
}
The schema for these classes looks like this:
CREATE TABLE MINION
(
ID IDENTITY PRIMARY KEY,
NAME VARCHAR(255),
COLOR VARCHAR(10),
VERSION INT
);
CREATE TABLE TOY
(
MINION BIGINT NOT NULL,
NAME VARCHAR(255)
);
And the repository interface is trivial for now:
interface MinionRepository extends CrudRepository<minion, {}
If we save a Minion that already exists in the database, the following happens:
1.
All Toys in the database of that minion get deleted.
2.
The minion itself gets updated.
3.
All the Toys that are currently part of that Minion get inserted into the database.
This is wasteful when there are many toys and none of them changed, was deleted, or added.
However, Spring Data JDBC does not have any information about this, and it should not, to keep it simple.
Also, you might know more in your code than Spring Data or any other tool or library knows, and you might be able to take advantage of that knowledge.
The next sections describe various ways of doing that.
Use a Reduced View of the Aggregate Root
Toys are an indispensable part of any proper minion but maybe there are domains that do not care about toys.
If so, there is nothing wrong about having a PlainMinionmapped to the same table:
@Table("MINION")
class PlainMinion {
@Id Long id;
String name;
@Version int version;
}
Since it does not know about toys, it lea[...]11 2月 2022, 11:24
11 2月 2022, ~11:25
8 290
Spring Boot 2.6.3 is now available
On behalf of the team and everyone who has contributed, I’m happy to announce that Spring Boot
2.6.3has been released and is now available from Maven Central.
This release includes 39 bug fixes, documentation improvements, and dependency upgrades. Thanks to all those who have contributed with issue reports and pull requests.
How can you help?
If you’re interested in helping out, check out the “ideal for contribution” tag in the issue repository. If you have general questions, please ask on stackoverflow.com using the spring-boottag or chat with the community on Gitter.
Project Page | GitHub | Issues | Documentation | Stack Overflow | Gitter
Читать: https://spring.io/blog/2022/01/20/spring-boot-2-6-3-is-now-available11 2月 2022, 11:24
11 2月 2022, ~11:25
8 290
Spring Boot 3.0.0-M1 is now available
On behalf of the team and everyone who has contributed, I’m happy to announce that Spring Boot
3.0.0-M1has been released and is now available from https://repo.spring.io/milestone.
This milestone starts our exciting journey to the next generation of the Spring Framework and raises our baseline from Java 8 to Java 17. We are planning to release a new milestone of Spring Boot 3.0 every two months. M2 should arrive on March 24 and we are planning on a GA release in late November.
If you are trying an existing application with Spring Boot 3.0 you’ll need to be aware that we’ve migrated all Java EE APIs to their equivalent Jakarta EE variant. For most users, this means you’ll need to replace any javaximports with jakarta. For example, javax.servlet.Filterwould be replaced with jakarta.servlet.Filter.
We’re still waiting for a few third-party libraries to release Jakarta EE compatible versions, so not all Spring Boot 2.x features are available with this first milestone. We plan to reintroduce features as and when libraries provide appropriate releases.
Please see the release notes for more details and upgrade instructions.
If you’re interested in trying this new release, you can easily generate a project from start.spring.io.
Thanks to all those who have contributed with issue reports and pull requests.
How can you help?
If you’re interested in helping out, check out the “ideal for contribution” tag in the issue repository. If you have general questions, please ask on stackoverflow.com using the spring-boottag or chat with the community on Gitter.
Project Page | GitHub | Issues | Documentation | Stack Overflow | Gitter
Читать: https://spring.io/blog/2022/01/20/spring-boot-3-0-0-m1-is-now-available11 2月 2022, 11:24
11 2月 2022, ~11:25
8 290
Spring Initializr 0.12.0 available now
On behalf of the team and everyone who has contributed, I’m happy to announce that Spring Initializr 0.12.0 has been released and is now available from Maven Central.
This release includes 10 fixes, improvements and dependency upgrades.
Thanks to all those who have contributed with issue reports and pull requests.
For full upgrade instructions and new and noteworthy features please see the release notes.
GitHub | Issues | Documentation | Stack Overflow | Gitter
Читать: https://spring.io/blog/2022/01/24/spring-initializr-0-12-0-available-now
11 2月 2022, 11:24
11 2月 2022, ~11:25
8 290
This Week in Spring - January 25th, 2022
Hi, Spring fans! Can you believe it’s already the 25th of the first month of a brand new year!? And we’re fast approaching the Lunar New Year, often also called the Chinese New Year, which will arrive next Tuesday. Reunion dinner will be on the 31st of January, and the two weeks of celebration will begin. All that to say that this is my last real chance, speaking I’m sure for the entire Tanzu team, to wish everyone around the planet (billions of people!) who celebrates a very happy Lunar New Year (Mandarin: 新年快乐 (pronounced: xin nian kauai le ) / Cantonese: 新年快乐 (pronounced: san nin fai lok )) and to say that we hope you enjoy prosperity in the new year (Mandarin: 恭喜发财 (pronounced: gong xi fa cai) / Cantonese: 恭喜发财 (pronounced: gong hei fat choy))!
That said, let’s get into this week’s epic roundup! There’s a ton of stuff.
* I was thrilled to participate in a discussion with AtomicJar’s Oleg Selajev about Spring Boot and Testcontainers this morning. Don’t miss this! It was so much fun and we introduced a ton of cool goodies.
* I had a lot of fun speaking at the JChampionsConference this morning about building Kubernetes Native Java. It was a lot of fun! I spoke for nearly 60 minutes and then fielded questions from folks for half an hour after the show! And of course, the legendary Mary Grygleski was a fantastic host and I loved catching up with her, too.
* I’ll be speaking at 11:00 AM GMT+3 on the 26th of January, 2022, to the Turkey Java Community. Join us!
* A Bootiful Podcast: RedHat’s Kate Stanley on the distinction between traditional brokers and Apache Kafka
* GraalVM 22.0 is here
* Blog: Securing Admission Controllers
* Elastic and Microsoft Azure - Unified Observability for Spring Boot applications
* Spring Batch 5.0 M1 released
* Spring Boot 2.5.9 available now
* Spring Boot 2.6.3 is now available
* Spring Boot 2.7.0-M1 is now available
* Spring Boot 3.0.0-M1 is now available
* Spring Data JDBC - How Can I Do a Partial Update of an Aggregate Root?
* Spring Initializr 0.12.0 available now
* Spring for GraphQL 1.0.0-M5 Released
Читать: https://spring.io/blog/2022/01/25/this-week-in-spring-january-25th-2022
11 2月 2022, 11:24
11 2月 2022, ~11:25
8 290
Spring Native 0.11.2 available now
On behalf of the team and everyone who has contributed, I’m happy to announce that Spring Native
0.11.2has been released and is now available from https://repo.spring.io/release.
This release includes 30 bug fixes, documentation improvements, and dependency upgrades. Thanks to all those who have contributed with issue reports and pull requests.
GitHub | Issues | Documentation
Читать: https://spring.io/blog/2022/01/26/spring-native-0-11-2-available-now11 2月 2022, 11:24
11 2月 2022, ~11:25
8 290
Spring Authorization Server 0.2.2 available now
On behalf of the team and everyone who has contributed, it is my pleasure to announce the general availability of Spring Authorization Server 0.2.2.
You can download it from Maven Central by using the module coordinates:
compile 'org.springframework.security:spring-security-oauth2-authorization-server:0.2.2'
See the release notes for complete details.
To get started using Spring Authorization Server, see the sample to become familiar with setup and configuration.
We would love to gather your feedback as we strive to improve and build upon this release.
Project Page | GitHub Issues | ZenHub Board
Читать: https://spring.io/blog/2022/01/26/spring-authorization-server-0-2-2-available-now11 2月 2022, 11:24
11 2月 2022, ~11:25
