This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hello. I've added a feature to NetBeans "Entity from database" wizard. There was no ability to affect name convertion mechanism of that wizard, but in some cases it may be useful. For example, if I have a database with the following tables: CREATE TABLE `Student` ( `idStudent` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `idTeacher` int(11) default NULL, PRIMARY KEY (`idStudent`), KEY `FKF3371A1B172E44FC` (`idTeacher`), CONSTRAINT `FKF3371A1B172E44FC` FOREIGN KEY (`idTeacher`) REFERENCES `Teacher` (`idTeacher`) ); CREATE TABLE `Teacher` ( `idTeacher` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL, PRIMARY KEY (`idTeacher`) ); then standard "Entity from database" wizard generates field idTeacher in Student class for that database. This field looks like an identifier but as a matter of fact it has a Teacher type. So, using prefix "id" for the name of that field may confuse a programmer. My patch provides an ability to affect name convertion mechanism for primary keys, foreign keys and foreign key referenced fields. Below is the detailed description of my feature I have written for NetBeans help: You may use regular expressions for converting and/or manual convertion (to adjust automatic name convertion for example). Regular expressions are applied separately for different field types. You may store your regular expression patterns using Add button (optional). You may use the following keywords in target expressions: 1. %>ENTITY% or %<ENTITY% is a name of a class which corresponding current field. If second charater is '>' then replacement begins with capital letter, if it is '<', then replacement begins with lower-case letter. 2. %>REFENTITY% or %<REFENTITY% can be used for foreign key and field corresponding to foreign key only. The replacement for this keyword is the referenced entity name. Also, you can use Java regular expression groups capturing mechanism. But with a little difference. You must use '>' or '<' symbol to indicate whether the first letter should be upper-case or lower-case. For example, $<1 is a first group but with decapitalized first letter.
Created attachment 81819 [details] patch
there is no advanced features like suggested so far, but there is an option for a few releases 'Use Column Names in relationships' and relationsship member may be generated two ways: private MicroMarket microMarket;; or private MicroMarket zip; //where zip is id member of MicroMarket
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss