Best of Spring FrameworkSeptember 2024

  1. 1
    Article
    Avatar of devgeniusDev Genius·2y

    GitHub Actions Step-by-Step Guide

    Learn how to deploy a Java Spring Boot application using GitHub Actions. This guide covers setting up a GitHub Actions workflow to build, test, and deploy the application to Docker Hub. The steps include creating a Maven project, configuring the YAML workflow file, and using Docker Hub for deployment. Securely manage Docker credentials using GitHub secrets.

  2. 2
    Article
    Avatar of javarevisitedJavarevisited·2y

    Review Spring Framework

    The Spring Framework uses Inversion of Control (IOC) to manage the control flow and object dependencies through mechanisms like dependency injection. The IOC container in Spring is represented by the Application Context, which manages the lifecycle of beans. Bean Factory and Application Context are two types of IOC containers, with the latter offering extended functionalities. Spring beans have different scopes such as Singleton, Prototype, Request, Session, and Application, each serving distinct use cases. The framework also supports various annotations for configuration and dependency management, and it allows the modularization of concerns via Aspect-Oriented Programming (AOP).

  3. 3
    Article
    Avatar of vladmihalceaVlad Mihalcea·2y

    A beginner’s guide to Spring Data Envers

    Spring Data Envers augments Spring Data JPA repositories by providing audit logging capabilities, allowing you to track entity changes with minimal application changes. Using annotations like @Audited, Hibernate generates audit logs for entity operations such as insert, update, and delete. Additionally, Spring Data Envers extends JPA repositories with methods to query entity revisions, facilitating audit log access and revision history tracking.

  4. 4
    Article
    Avatar of baeldungBaeldung·2y

    Guide to @DynamicInsert in Spring Data JPA

    The @DynamicInsert annotation in Spring Data JPA optimizes insert operations by generating SQL statements that include only non-null fields, enhancing efficiency for entities with many nullable fields. However, it incurs runtime overhead and should be used selectively, especially when dealing with entities with default values or critical insert performance requirements. It may introduce complexity and inefficiencies in cases with mostly non-null fields, bulk insertions, or intricate database constraints.

  5. 5
    Article
    Avatar of baeldungBaeldung·2y

    How to Make a Field Optional in JPA Entity?

    When working with Spring Data and databases, it's sometimes necessary to make certain fields optional to improve performance and reduce overhead. This guide explores various techniques for achieving this, including projections, DTOs, @SqlResultSetMapping, and using Object or Tuple for native queries. Examples and tests demonstrate how to selectively fetch only the necessary fields from a table.

  6. 6
    Article
    Avatar of newstackThe New Stack·2y

    Spring AI Transforms Java for GenAI App Delivery

    Generative AI has gained significant attention for its ability to create media using large language models (LLMs). Incorporating GenAI models into applications opens up new possibilities for developing features previously unattainable due to practical or cost constraints. Spring AI, an extension for Spring and Spring Boot, offers Java developers a framework for working with various AI providers, enabling them to build enterprise-ready AI applications using familiar tools. It supports multiple model types and providers, simplifying complex interactions and integrating enterprise data efficiently. RAG and function calling techniques further enhance AI model capabilities.

  7. 7
    Article
    Avatar of baeldungBaeldung·2y

    Guide to Hibernate’s @TimeZoneStorage Annotation

    Spring Data Commons offers a base for various Spring Data modules, enabling easy persistence. Handling timestamps with timezones is tricky in databases, as common types like OffsetDateTime and ZonedDateTime aren't supported by JPA. Hibernate 6's @TimeZoneStorage annotation solves this, providing strategies to manage timezone information in databases. This tutorial covers practical examples and the behavior of each storage strategy, helping developers choose the best one for their needs.