Netbeans <;实体>;无法添加,因为它已映射到<;包装>;实体类,该实体不在当前项目源中
我认为Netbeans中的缓存可能有问题,这导致从数据库创建新的Netbeans <;实体>;无法添加,因为它已映射到<;包装>;实体类,该实体不在当前项目源中,netbeans,jdbc,glassfish,database-connection,connection-pooling,Netbeans,Jdbc,Glassfish,Database Connection,Connection Pooling,我认为Netbeans中的缓存可能有问题,这导致从数据库创建新的实体类时出现问题… Netbeans错误: clients cannot be added because it is already mapped to the net.bounceme.dur.jpa.Client entity class and the entity is not in current project source. 注意,这是在使用资源jdbc/ejb IDE生成的persistence.xml: &l
实体类时出现问题…
Netbeans错误:
clients cannot be added because it is already mapped to the net.bounceme.dur.jpa.Client entity class and the entity is not in current project source.
注意,这是在使用资源jdbc/ejb
IDE生成的persistence.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="A-ejbPU" transaction-type="JTA">
<jta-data-source>jdbc/ejb</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
</properties>
</persistence-unit>
</persistence>
另一个资源,位于:
虽然我认为glassfish服务器上的资源是可用的,但可能存在一些相互作用
我查过:
thufir@dur:~$
thufir@dur:~$ ls /home/thufir/.netbeans
8.0.1
thufir@dur:~$
thufir@dur:~$ ls /home/thufir/netbeans-8.0.1/
apisupport etc java nb README.html websvccommon
bin extide javafx netbeans.css THIRDPARTYLICENSE.txt
CREDITS.html harness LICENSE.txt platform uninstall.sh
enterprise ide moduleCluster.properties profiler webcommon
thufir@dur:~$
另见:
也许我只是没有看到缓存,假设这就是问题所在?可能在这里:但我不知道这是否真的能解决问题。我按照删除了
。cache/netbeans/8.0.1
,尽管我不知道根本的问题是什么。这允许从数据库连接创建实体类。
thufir@dur:~/NetBeansProjects$
thufir@dur:~/NetBeansProjects$ /home/thufir/glassfish-4.1/glassfish/bin/asadmin
Use "exit" to exit and "help" for online help.
asadmin>
asadmin> list-jdbc-connection-pools
CLI031: Warning: Option "target" is obsolete and will be ignored.
CLI031: Warning: Option "target" is obsolete and will be ignored.
__TimerPool
DerbyPool
SamplePool
connectionPool
legacy_on_glassfish
Command list-jdbc-connection-pools executed successfully.
asadmin>
asadmin> ping-connection-pool legacy_on_glassfish
Command ping-connection-pool executed successfully.
asadmin>
asadmin> list-jdbc-resources
jdbc/sample
jdbc/__TimerPool
jdbc/__default
jdbc/local
jdbc/legacy_resource
Command list-jdbc-resources executed successfully.
asadmin>
asadmin> exit
Command multimode executed successfully.
thufir@dur:~/NetBeansProjects$
thufir@dur:~$
thufir@dur:~$ ls /home/thufir/.netbeans
8.0.1
thufir@dur:~$
thufir@dur:~$ ls /home/thufir/netbeans-8.0.1/
apisupport etc java nb README.html websvccommon
bin extide javafx netbeans.css THIRDPARTYLICENSE.txt
CREDITS.html harness LICENSE.txt platform uninstall.sh
enterprise ide moduleCluster.properties profiler webcommon
thufir@dur:~$