POJO Persistence via Annotations and SQL
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current approaches for persisting Plain Old Java Objects (POJOs) to databases are intrusive, difficult to maintain, and require users to learn multiple query languages, making the process complex and time-consuming.
Innovation Solution
Using SQL for retrieval and annotations for persistence, allowing developers to leverage the full querying power of their database management system without needing additional query languages, and an enhanced compiler generates bytecode for managing POJO persistence automatically.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If additional methods are introduced or existing methods are modified to support POJO persistence, then persistence functionality is achieved, but the POJO behavior may be altered unintentionally and the approach becomes intrusive
Solution Approach 1:
The patent introduces an intermediary persistence layer that sits between the POJO and the database, using annotations to define persistence behavior without modifying POJO methods. This mediator approach allows persistence functionality to be added while keeping the POJO behavior intact and unchanged.
Solution Approach 2:
The patent segments persistence functionality into separate annotation-based configurations rather than integrating it into the POJO class structure itself. This separation allows persistence to be configured independently through annotations while the POJO remains unchanged, preventing behavioral alterations.
2Reliability
If additional descriptive files and methods are added to specify POJO persistence, then persistence capability is provided, but the complexity of organization and maintenance increases significantly
Solution Approach 1:
The patent merges persistence configuration directly into the POJO class file using annotations, eliminating the need for separate descriptive files. This consolidation reduces organizational complexity and makes maintenance easier by keeping all persistence-related information in one location within the existing code structure.
Solution Approach 2:
The annotation-based approach provides a universal mechanism that can be applied to any POJO without requiring additional files or specialized configurations. The same annotation system handles all persistence aspects, simplifying maintenance across the entire codebase.
3Reliability
If multiple query languages and additional descriptive files are required for POJO persistence, then comprehensive persistence control is achieved, but the burden on users increases and the process becomes time-consuming
Solution Approach 1:
The patent uses a universal annotation system that works with SQL queries without requiring users to learn additional query languages. The annotations provide a multi-functional interface that handles both query definition and persistence configuration, reducing the time and knowledge burden on users while maintaining comprehensive control.
Solution Approach 2:
The enhanced compiler automatically generates bytecode for POJO persistence management based on the annotations, reducing the manual effort required. The system serves itself by automatically handling the complex tasks of bytecode generation and persistence configuration, allowing users to focus only on defining their annotations and SQL queries.
4Adaptability or versatility
If high-level query languages like EJB-QL are used to query POJOs without requiring knowledge of underlying database types, then database independence is achieved, but the query language becomes less expressive than SQL
Solution Approach 1:
The patent introduces an intermediary layer where SQL queries are written against the POJO class structure with annotations, rather than directly against database tables. This mediator approach maintains database independence by abstracting the underlying database types while preserving the full expressiveness of SQL, as users can write standard SQL that operates on the annotated POJO model.
Data Source
AI summary
The present invention uses annotations and SQL to retrieve and/or persist POJO data from/to a database, respectively. Using SQL will enable developers to unleash the full querying power of their chosen Database Management Systems (DBMS) and will remove the requirement that they learn a new query language. A minimal amount of annotations will be associated in the same Java® source file where each class of POJO to be persisted to the database is defined. An enhanced compiler is capable of analyzing the annotated source file and automatically generate the bytecode required to create, deploy, and manage the persistence of POJOs without requiring knowledge of specific details of the persistence to corresponding data entities in the underlining database. Therefore, such an approach decreases the time, knowledge, skill and ultimately cost required to persist POJOs to an underlying database. This description is not intended to be a complete description of, or limit the scope of, the invention. Other features, aspects, and objects of the invention can be obtained from a review of the specification, the figures, and the claims.


