How to correctly use JPA + eclipselink + java

Database
Den
N/A

How to correctly use JPA + eclipselink + java

Please tell me how teradata interacts with Java in the implementation of JPA. When meping two classes where a one-to-many an error:

[EL Config]: metadata: 2013-03-06 11:39:10.038--ServerSession(4212265)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.test_log.log.Packet] is set to [FIELD].

[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [field files] is being defaulted to: class com.test_log.log.File.

[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.test_log.log.File] is set to [FIELD].

[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [field packet] is being defaulted to: class com.test_log.log.Packet.

[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.test_log.log.Packet] is being defaulted to: Packet.

[EL Config]: metadata: 2013-03-06 11:39:10.069--ServerSession(4212265)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.test_log.log.File] is being defaulted to: File.

org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl@1271a80

[EL Severe]: ejb: 2013-03-06 11:39:10.303--ServerSession(4212265)--Thread(Thread[main,5,main])--java.lang.NullPointerException

Exception in thread "main" javax.persistence.PersistenceException: java.lang.NullPointerException

    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:602)

    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)

    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)

    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)

    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)

    at com.test_log.log.Main.main(Main.java:18)

Caused by: java.lang.NullPointerException

    at java.util.ResourceBundle.getBundle(Unknown Source)

    at org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:47)

    at org.eclipse.persistence.exceptions.ValidationException.errorDecryptingPassword(ValidationException.java:873)

    at org.eclipse.persistence.internal.security.JCEEncryptor.decryptPassword(JCEEncryptor.java:124)

    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateLogins(EntityManagerSetupImpl.java:1817)

    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateSession(EntityManagerSetupImpl.java:2121)

    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:523)

    ... 5 more

Give an example of eclipselink + java + teradata (JPA). Or documentation with an example. And another question why no plugin for Eclipse teradata operating system Windows 7 x64.

1 REPLY

Re: How to correctly use JPA + eclipselink + java

Can you show the source of the Packet class and Field class?