apache / apache/netbeans

JPA: automatically validate table and column names in entity beans

Open
#4,915 0 comments 0 reactions 0 assignees View on GitHub
kind:feature needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

For projects that use JPA, NetBeans IDE offers the auto-completion of table and column names when you edit entity beans. Since the editor is already aware of that information, I wonder if it could also detect when a table or column name doesn't exist in the database, and then mark the failed `@Table` and `@Column` annotation.

Thank you!

#### How do I make auto-completion work?

I use Wildfly AS as application server, so this is what I do to get auto-completion:

1. In Wildfly AS, configure a data source.

1. In NetBeans IDE, configure a database in *Services → Databases* that uses exactly the same URL used to configure the data source in Wildfly AS. Then, connect to it.

1. In NetBeans IDE, configure Wildfly AS in *Services → Servers*.

1. In the Java project, in the persistence descriptor (`persistence.xml`), configure a persistence unit that uses the data source configured in Wildfly AS.

### Use case/motivation

The only motivation is to detect errors early, during the development phase, instead of discovering them at runtime.

### Related issues

_No response_

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start by tracing NetBeans' existing JPA entity-bean completion and how the persistence.xml data source is resolved. Define how database metadata should be checked for @Table and @Column names, then verify that nonexistent names are marked in the editor without disrupting existing completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.