Javadoc JPA Entities

I want javadoc to generate table names & column information from jpa annotations, does anyone know of any existing settings for javadoc to produce this? Or perhaps a custom doclet? I haven't had any luck searching for one, closest I've come is finding a project on Google Code that will eventually produce one...

Captain_Pierce wrote:
I want javadoc to generate table names & column information from jpa annotations, does anyone know of any existing settings for javadoc to produce this?There are no such settings.

Similar Messages

  • How to create a cache for JPA Entities using an EJB

    Hello everybody! I have recently got started with JPA 2.0 (I use eclipseLink) and EJB 3.1 and have a problem to figure out how to best implement a cache for my JPA Entities using an EJB.
    In the following I try to describe my problem.. I know it is a bit verbose, but hope somebody will help me.. (I highlighted in bold the core of my problem, in case you want to first decide if you can/want help and in the case spend another couple of minutes to understand the domain)
    I have the following JPA Entities:
    @Entity Genre{
    private String name;
    @OneToMany(mappedBy = "genre", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<Novel> novels;
    @Entity
    class Novel{
    @ManyToOne(cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Genre genre;
    private String titleUnique;
    @OneToMany(mappedBy="novel", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> editions;
    @Entity
    class NovelEdition{
    private String publisherNameUnique;
    private String year;
    @ManyToOne(optional=false, cascade={CascadeType.PERSIST, CascadeType.MERGE})
    private Novel novel;
    @ManyToOne(optional=false, cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Catalog appearsInCatalog;
    @Entity
    class Catalog{
    private String name;
    @OneToMany(mappedBy = "appearsInCatalog", cascade = {CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> novelsInCatalog;
    The idea is to have several Novels, belonging each to a specific Genre, for which can exist more than an edition (different publisher, year, etc). For semplicity a NovelEdition can belong to just one Catalog, being such a Catalog represented by such a text file:
    FILE 1:
    Catalog: Name Of Catalog 1
    "Title of Novel 1", "Genre1 name","Publisher1 Name", 2009
    "Title of Novel 2", "Genre1 name","Pulisher2 Name", 2010
    FILE 2:
    Catalog: Name Of Catalog 2
    "Title of Novel 1", "Genre1 name","Publisher2 Name", 2011
    "Title of Novel 2", "Genre1 name","Pulisher1 Name", 2011
    Each entity has associated a Stateless EJB that acts as a DAO, using a Transaction Scoped EntityManager. For example:
    @Stateless
    public class NovelDAO extends AbstractDAO<Novel> {
    @PersistenceContext(unitName = "XXX")
    private EntityManager em;
    protected EntityManager getEntityManager() {
    return em;
    public NovelDAO() {
    super(Novel.class);
    //NovelDAO Specific methods
    I am interested at when the catalog files are parsed and the corresponding entities are built (I usually read a whole batch of Catalogs at a time).
    Being the parsing a String-driven procedure, I don't want to repeat actions like novelDAO.getByName("Title of Novel 1") so I would like to use a centralized cache for mappings of type String-Identifier->Entity object.
    Currently I use +3 Objects+:
    1) The file parser, which does something like:
    final CatalogBuilder catalogBuilder = //JNDI Lookup
    //for each file:
    String catalogName = parseCatalogName(file);
    catalogBuilder.setCatalogName(catalogName);
    //For each novel edition
    String title= parseNovelTitle();
    String genre= parseGenre();
    catalogBuilder.addNovelEdition(title, genre, publisher, year);
    //End foreach
    catalogBuilder.build();
    2) The CatalogBuilder is a Stateful EJB which uses the Cache and gets re-initialized every time a new Catalog file is parsed and gets "removed" after a catalog is persisted.
    @Stateful
    public class CatalogBuilder {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private Cache cache;
    private Catalog catalog;
    @PostConstruct
    public void initialize() {
    catalog = new Catalog();
    catalog.setNovelsInCatalog(new ArrayList<NovelEdition>());
    public void addNovelEdition(String title, String genreStr, String publisher, String year){
    Genre genre = cache.findGenreCreateIfAbsent(genreStr);//##
    Novel novel = cache.findNovelCreateIfAbsent(title, genre);//##
    NovelEdition novEd = new NovelEdition();
    novEd.setNovel(novel);
    //novEd.set publisher year catalog
    catalog.getNovelsInCatalog().add();
    public void setCatalogName(String name) {
    catalog.setName(name);
    @Remove
    public void build(){
    em.merge(catalog);
    3) Finally, the problematic bean: Cache. For CatalogBuilder I used an EXTENDED persistence context (which I need as the Parser executes several succesive transactions) together with a Stateful EJB; but in this case I am not really sure what I need. In fact, the cache:
    Should stay in memory until the parser is finished with its job, but not longer (should not be a singleton) as the parsing is just a very particular activity which happens rarely.
    Should keep all of the entities in context, and should return managed entities form mehtods marked with ##, otherwise the attempt to persist the catalog should fail (duplicated INSERTs)..
    Should use the same persistence context as the CatalogBuilder.
    What I have now is :
    @Stateful
    public class Cache {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private sessionbean.GenreDAO genreDAO;
    //DAOs for other cached entities
    Map<String, Genre> genreName2Object=new TreeMap<String, Genre>();
    @PostConstruct
    public void initialize(){
    for (Genre g: genreDAO.findAll()) {
    genreName2Object.put(g.getName(), em.merge(g));
    public Genre findGenreCreateIfAbsent(String genreName){
    if (genreName2Object.containsKey(genreName){
    return genreName2Object.get(genreName);
    Genre g = new Genre();
    g.setName();
    g.setNovels(new ArrayList<Novel>());
    genreDAO.persist(t);
    genreName2Object.put(t.getIdentifier(), em.merge(t));
    return t;
    But honestly I couldn't find a solution which satisfies these 3 points at the same time. For example, using another stateful bean with an extended persistence context (PC) would work for the 1st parsed file, but I have no idea what should happen from the 2nd file on.. Indeed, for the 1st file the PC will be created and propagated from CatalogBuilder to Cache, which will then use the same PC. But after build() returns, the PC of CatalogBuilder should (I guess) be removed and re-created during the succesive parsing, although the PC of Cache should stay "alive": shouldn't in this case an exception being thrown? Another problem is what to do when the Cache bean is passivated. Currently I get the exception:
    "passivateEJB(), Exception caught ->
    java.io.IOException: java.io.IOException
    at com.sun.ejb.base.io.IOUtils.serializeObject(IOUtils.java:101)
    at com.sun.ejb.containers.util.cache.LruSessionCache.saveStateToStore(LruSessionCache.java:501)"
    Hence, I have no Idea how to implement my cache.. Can you please tell me how would you solve the problem?
    Many thanks!
    Bye

    Hi Chris,
    thanks for your reply!
    I've tried to add the following into persistence.xml (although I've read that eclipseLink uses L2 cache by default..):
    <shared-cache-mode>ALL</shared-cache-mode>
    Then I replaced the Cache bean with a stateless bean which has methods like
    Genre findGenreCreateIfAbsent(String genreName){
    Genre genre = genreDAO.findByName(genreName);
    if (genre!=null){
    return genre;
    genre = //Build new genre object
    genreDAO.persist(genre);
    return genre;
    As far as I undestood, the shared cache should automatically store the genre and avoid querying the DB multiple times for the same genre, but unfortunately this is not the case: if I use a FINE logging level, I see really a lot of SELECT queries, which I didn't see with my "home made" Cache...
    I am really confused.. :(
    Thanks again for helping + bye

  • EJB 3.0 JPA Entities and preserving user identities

    Hello all,
    I've been reading about some of the techniques available to Oracle DB developers to ensure that some sense of a user's real identity is maintained in multitier applications (<http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14266/apdvprxy.htm>).
    I was wondering if either of the methods described (proxy authentication or the use of the CLIENT_IDENTIFIER attribute) could be used in conjunction with EJB 3.0 JPA Entity beans (in an OC4J container).
    If so, I would really appreciate any pointers to useful documentation! I've read something about the use of proxy authentication with TopLink (<http://www.oracle.com/technology/products/ias/toplink/doc/11110/relnotes/toplink-relnotes.html#BABHEFEF>), but I'm not sure how this relates to the use of Entity beans.
    Many thanks,
    Alistair.

    Just to close this thread out...
    Under another thread: <JPA Entities with Proxy Authentication / OC4J bug it was determined that this is NOT possible with OC4J 10g, but should be supported by 11g.
    Alistair.

  • JPA entities to the database generation

    Hi,
    I am trying to create JPA entities in an EJB diagram and then automatically get the tables created in a database schema. I started by creating some entities from the Entity wizard, then added some fields, dragged them into the diagram and added some relationships.
    With that done, I noticed that the tables in the offline database created by the wizard don't get updated with the new fields of the entities (they have only the id and version fields). And I couldn't figure out how to do so.
    Then, I tried to use the option 'Synchronize with database -> Generate to' option in the context menu from the EJB diagram, but its options appear disabled for me.
    Please, tell me if I am doing something wrong or expecting anything that the tool is not able to do for me.
    Thanks for any help.

    Disabling the bind variables produces the following:
    INSERT INTO BIG_NUM (ID, NUM) VALUES (2, 9999999999999999.00)The database still joyfully contains a rounded number:
    SQL> select * from big_num;
                     ID                   NUM
                      2  10000000000000000,00So, no, it's not an issue with the bind variables. I need to examine the JDBC driver but could you tell me how I can find out what Oracle JDBC driver is used by JPA? Or... is it some other JDBC driver (not Oracle, that is)?
    Best regards,
    Bisser
    P.S. We use the following version of TopLink Essentials:
    TopLink, version: Oracle TopLink Essentials - 2.1 (Build b60-fcs (11/17/2008))
    Edited by: bisser on Jan 28, 2009 9:25 AM

  • Error received on creating jpa entities

    Hello,
    I am using jdeveloper 11.1.1.7 and am working with a simple test of creating a row in a table.  I have created the Jpa entities as described on
    Oracle JDeveloper 11g Release 2 Tutorials - Building a JPA Application and
    EJB 3.0 component exposed as webservice using Oracle JDeveloper: Create simple EJB component, exposed it as a webservice…
    which deals more with creating an actual row in the table.
    I run it and I get a huge list of depreciated methods and an error.  It does load the data, which is great, but I cannot use this in production with all the errors produced!
    This is pretty bad considering most of the code was generated using the wizards....
    Any ideas?
    C:\Oracle11117\Middleware\jdk160_24\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\XML\.adf;C:\JDeveloper\mywork\XML\Jpa_EntitiesAgain\classes;C:\Oracle11117\Middleware\modules\com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar;C:\Oracle11117\Middleware\modules\org.eclipse.persistence_1.1.0.0_2-1.jar;C:\Oracle11117\Middleware\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle11117\Middleware\modules\javax.persistence_1.0.0.0_2-0-0.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\Oracle11117\Middleware\modules\javax.jsf_1.1.0.0_1-2.jar;C:\Oracle11117\Middleware\modules\javax.ejb_3.0.1.jar;C:\Oracle11117\Middleware\modules\javax.enterprise.deploy_1.2.jar;C:\Oracle11117\Middleware\modules\javax.interceptor_1.0.jar;C:\Oracle11117\Middleware\modules\javax.jms_1.1.1.jar;C:\Oracle11117\Middleware\modules\javax.jsp_1.2.0.0_2-1.jar;C:\Oracle11117\Middleware\modules\javax.jws_2.0.jar;C:\Oracle11117\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle11117\Middleware\modules\javax.mail_1.1.0.0_1-4-1.jar;C:\Oracle11117\Middleware\modules\javax.xml.soap_1.3.1.0.jar;C:\Oracle11117\Middleware\modules\javax.xml.rpc_1.2.1.jar;C:\Oracle11117\Middleware\modules\javax.xml.ws_2.1.1.jar;C:\Oracle11117\Middleware\modules\javax.management.j2ee_1.0.jar;C:\Oracle11117\Middleware\modules\javax.resource_1.5.1.jar;C:\Oracle11117\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle11117\Middleware\modules\javax.transaction_1.0.0.0_1-1.jar;C:\Oracle11117\Middleware\modules\javax.xml.stream_1.1.1.0.jar;C:\Oracle11117\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle11117\Middleware\modules\javax.xml.registry_1.0.0.0_1-0.jar;C:\Oracle11117\Middleware\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;C:\Oracle11117\Middleware\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle11117\Middleware\oracle_common\modules\oracle.dms_11.1.1\dms.jar -Djavax.net.ssl.trustStore=C:\Oracle11117\Middleware\wlserver_10.3\server\lib\DemoTrust.jks jpa_entities.Serve.JavaServiceFacade
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.user is deprecated, property javax.persistence.jdbc.user should be used instead.
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.driver is deprecated, property javax.persistence.jdbc.driver should be used instead.
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.url is deprecated, property javax.persistence.jdbc.url should be used instead.
    [EL Info]: 2013-10-07 15:35:17.703--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.password is deprecated, property javax.persistence.jdbc.password should be used instead.
    [EL Finer]: 2013-10-07 15:35:17.718--ServerSession(13419912)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/JDeveloper/mywork/XML/Jpa_EntitiesAgain/classes/
    [EL Finer]: 2013-10-07 15:35:17.734--ServerSession(13419912)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/JDeveloper/mywork/XML/Jpa_EntitiesAgain/classes/
    [EL Config]: 2013-10-07 15:35:17.812--ServerSession(13419912)--Thread(Thread[main,5,main])--The access type for the persistent class [class jpa_entities.JpaTest] is set to [FIELD].
    [EL Config]: 2013-10-07 15:35:17.828--ServerSession(13419912)--Thread(Thread[main,5,main])--The alias name for the entity class [class jpa_entities.JpaTest] is being defaulted to: JpaTest.
    [EL Config]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--The column name for element [field test1] is being defaulted to: TEST1.
    [EL Config]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--The column name for element [field test2] is being defaulted to: TEST2.
    [EL Finer]: 2013-10-07 15:35:17.843--Thread(Thread[main,5,main])--JavaSECMPInitializer - transformer is null.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.user is deprecated, property javax.persistence.jdbc.user should be used instead.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.driver is deprecated, property javax.persistence.jdbc.driver should be used instead.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.url is deprecated, property javax.persistence.jdbc.url should be used instead.
    [EL Info]: 2013-10-07 15:35:17.843--ServerSession(13419912)--Thread(Thread[main,5,main])--property eclipselink.jdbc.password is deprecated, property javax.persistence.jdbc.password should be used instead.
    [EL Finer]: 2013-10-07 15:35:17.859--ServerSession(13419912)--Thread(Thread[main,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Info]: 2013-10-07 15:35:18.25--ServerSession(13419912)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.1.3.v20110304-r9073
    [EL Warning]: 2013-10-07 15:35:18.25--Thread(Thread[main,5,main])--java.lang.ClassNotFoundException: weblogic.version
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:81)
      at org.eclipse.persistence.platform.server.wls.WebLogicPlatform.initializeServerNameAndVersion(WebLogicPlatform.java:85)
      at org.eclipse.persistence.platform.server.ServerPlatformBase.getServerNameAndVersion(ServerPlatformBase.java:181)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:653)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:576)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:389)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:164)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:221)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:209)
      at jpa_entities.Serve.JavaServiceFacade.getEntityManager(JavaServiceFacade.java:37)
      at jpa_entities.Serve.JavaServiceFacade._persistEntity(JavaServiceFacade.java:53)
      at jpa_entities.Serve.JavaServiceFacade.persistJpaTest(JavaServiceFacade.java:75)
      at jpa_entities.Serve.JavaServiceFacade.main(JavaServiceFacade.java:32)
    [EL Fine]: 2013-10-07 15:35:18.812--Thread(Thread[main,5,main])--Detected Vendor platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Config]: 2013-10-07 15:35:18.828--ServerSession(13419912)--Connection(21411547)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
      platform=>Oracle10Platform
      user name=> "stuartf"
      datasource URL=> "jdbc:oracle:thin:@lpgtr82:1521:test11g"
    [EL Config]: 2013-10-07 15:35:18.859--ServerSession(13419912)--Connection(15399793)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@lpgtr82:1521:test11g
      User: STUARTF
      Database: Oracle  Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
      Driver: Oracle JDBC driver  Version: 11.2.0.3.0
    [EL Info]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--file:/C:/JDeveloper/mywork/XML/Jpa_EntitiesAgain/classes/_Jpa_EntitiesAgain-1 login successful
    [EL Warning]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    [EL Warning]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    [EL Warning]: 2013-10-07 15:35:19.078--ServerSession(13419912)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    [EL Finer]: 2013-10-07 15:35:19.093--ServerSession(13419912)--Thread(Thread[main,5,main])--Canonical Metamodel class [jpa_entities.JpaTest_] not found during initialization.
    [EL Finer]: 2013-10-07 15:35:19.109--ServerSession(13419912)--Thread(Thread[main,5,main])--client acquired
    [EL Finer]: 2013-10-07 15:35:19.109--UnitOfWork(7819553)--Thread(Thread[main,5,main])--begin unit of work commit
    [EL Finer]: 2013-10-07 15:35:19.109--ClientSession(32803057)--Connection(15399793)--Thread(Thread[main,5,main])--begin transaction
    [EL Fine]: 2013-10-07 15:35:19.125--ClientSession(32803057)--Connection(15399793)--Thread(Thread[main,5,main])--INSERT INTO JPA_TEST (JPA_TEST_ID, TEST1, TEST2) VALUES (?, ?, ?)
      bind => [2, hello, there]
    [EL Finer]: 2013-10-07 15:35:19.203--ClientSession(32803057)--Connection(15399793)--Thread(Thread[main,5,main])--commit transaction
    [EL Finer]: 2013-10-07 15:35:19.218--UnitOfWork(7819553)--Thread(Thread[main,5,main])--end unit of work commit
    [EL Finer]: 2013-10-07 15:35:19.218--UnitOfWork(7819553)--Thread(Thread[main,5,main])--resume unit of work
    [EL Finer]: 2013-10-07 15:35:19.218--UnitOfWork(7819553)--Thread(Thread[main,5,main])--release unit of work
    [EL Finer]: 2013-10-07 15:35:19.218--ClientSession(32803057)--Thread(Thread[main,5,main])--client released
    Process exited with exit code 0.

    The error seems caused by the persistence.xml specifying that EclipseLink should use the weblogic server platform, but you are not running your example within WLS.  This causes an internal exception when it tries to load WebLogic classes which are unavailable.  It is only printing off the exception at the warning level to indicate you do not have the correct settings for your test environment. 
    Ideally you would only want the log level set to severe or off in production, as any exceptions would be propagated up to the application anyway.
    Best Regards,
    Chris

  • JDev generates incomplete Tables from JPA entities

    I've got some JPA entities and I'm trying to generate the DB schema from them in Jdeveloper.
    All tables are only generated with the Id (Primary Key) and not any additional fields/constraints I've defined in the Entity classes.
    Any ideas what I should be looking at?
    JDev 11.1.1.3 connecting to Oracle 10g XE
    Edited by: new_to_webcenter on 21-Jan-2011 03:20

    @Shay,
    In a new JPA app, I've created
    New Business Tier > EJB > Entity
    Choose Persistence Unit and OFfline DB , Choose No Inheritance
    Ticked on "Create Offline Table"
    Include @Id field without a Sequencer
    In the generated Entity class, I've added a new private field Name with setter/getter.
    I've added these via the Structure > EJB > Add new field > generate accessors.
    I've also specified @Column for the private field Name .
    Next in the offline DB source, I right-click the Table > Generate to Connection > and go through the steps , choosing CREATE table.
    In the created table as well as the generated SQL script, the Name column does not appear.
    It creates a table in the DB with only the ID column.
    Edit: I've checked again - if i click on the offline db source > table > columns - even there it only shows ID and no NAME column.
    Any ideas - i'm definitely missing a step?
    In persistence.xml I've specified
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    <property name="eclipselink.ddl-generation.output-mode"
                        value="database" />
    @dvohra16 : Nope I dont need the sequencer at present.
    Edited by: new_to_webcenter on 21-Jan-2011 22:37
    Edited by: new_to_webcenter on 21-Jan-2011 22:58

  • JPA, entities

    Hy,
    I want to implement a management application which associates developers with projects. The problem is that I am new to the Java Persistence API and to Java EE in general, I have read the Java EE 5 tutorial, but it wasn't what I was hoping for. I need help implementing the entites and the relationships between them.
    I have ResourceEntity and ProjectEntity for developers and projects, respectively. (Developers are called resources.) I also have a third entity, AssignmentEntity, which is used to establish a many-to-many relationship between ResourceEntity and ProjectEntity.
    Now, I know that in JPA there is no need for a separate entity to establish a many-to-many relationship between two other entities, but AssignmentEntity contains useful information about the relationship itself, like assignment start and end date.
    So instead of a many-to-many relationship between ResourceEntity and ProjectEntity I want to have a one-to-many relationship between ResourceEntity and AssignmentEntity and a many-to-one relationship between AssignmentEntity and ProjectEntity.
    One problem is that I don't know how to implement these relationships. Another is that I need a composite primary key for AssignmentEntity, made up of two foreign keys, one to ResourceEntity and another to ProjectEntity.
    I would really appreciate some help.
    Thanks,
    Csabi

    Hy supercoder97,
    Thank you so much for the titles. I don't really trust Amazon reviews so I would really appreciate if you would give me an idea about how technical these books really are.
    I prefer highly technical documents, the ones just short of the standards themselves, which I also read, eventually. I really like books with precise and correct information.
    I read a lot of computer science books. We could exchange titles if you're interested. I have been programming for almost ten years now and like I said, I'm pretty new to Java EE, and to Web technologies in general (1 year experience), but I'm pretty seasoned in quite a few other technologies/programming languages.
    Thanks,
    Csabi

  • JPA Entities and Spatial

    I have generated Entities from tables using Jdeveloper 11 and Spatial columns of
    type MDSYS.SDO_GEOMETRY were translated to Java String type.
    I am looking for a strategy (custom mappings/annotations, etc) which will apply
    an Oracle spatial function on the field and make the type conversion required
    to insert into the Spatial column type.

    Yes, your field would be like,
    @Convert(value="JGeometry")
    @StructConverter(name="JGeometry", converter="JGEOMETRY")
    protected JGeometry myJGeometry;
    There is an in the EclipseLink SVN repository that you may wish to look at,
    <SVN>foundation/eclipselink.extension.oracle.test/src/org/eclipse/persistence/testing/models/jpa/structconverter
    James : http://www.eclipselink.org

  • What would be my JPA Entities ??

    Hello Everyone.
    I have a confusion.
    In my database i have 3 tables.
    1) University (id, Name)
    2) Specialization (id, Name)
    3) Degree (id, Name)
    and one relationship table.
    4) degree_prog_replationshiip (id, university_id, specialization_id, degree_id)
    i am not able to design my entity classes.
    Please tell me how would be my entity classes?
    Thanks.

    >
    >
    > In the degree entity for example it has a one to many relationship expressed as a List of degree_prog_replationship entities. Then in the degree_prog_replationship entity you have a many to one relationship to the degree entity. Then the same for each of the other 2 entity types.
    >
    Here entity classes.
    University.java package entities;
    import java.io.Serializable;
    import java.util.List;
    import javax.persistence.*;
    @Entity
    @Table(name="university")
    public class University implements Serializable {
    @Id
    @GeneratedValue(generator="university_id_seq",strategy=GenerationType.SEQUENCE)
    @Column(name="id")
    private int universityId = 0;
    @Column(name = "name")
    private String universityName = "";
    @OneToMany(mappedBy="university",cascade=CascadeType.PERSIST,CascadeType.REMOVE})
    private List<DegreeProgam> degreeProg;
    public void University(){ }
    public void setUniversityId(int universityId) { this.universityId = universityId; }
    public int getUniversityId() { return this.universityId; }
    public void setUniversityName(String universityName) {
    this.universityName = universityName;
    public String getUniversityName() { return this.universityName; }
    public List<DegreeProgram> getDegreeProg() { return degreeProg; }
    public void setDegreeProg(List degreeProg) {
    this.degreeProg = degreeProg;
    } }Specialization.java
    package entities;
    import java.io.Serializable;
    import java.util.List;
    import javax.persistence.*;
    @Entity
    @Table(name="specialization")
    public class Specialization implements Serializable {
    @Id
    @GeneratedValue(generator="specialization_id_seq",strategy=GenerationType.SEQUENCE)
    @Column(name="id")
    private int specializationId = 0;
    @Column(name="name")
    private String specializationName = "";
    public void Specialization() { }
    public void setSpecializationId(int specializationId) {
    this.specializationId = specializationId;
    public int getSpecializationId() { return this.specializationId;}
    public void setSpecializationName(String specializationName) {
    this.specializationName = specializationName;
    public String getSpecializationName() { return this.specializationName;}
    }Degree.java
    package entities;
    import java.io.Serializable;
    import java.util.List;
    import javax.persistence.*;
    @Entity
    @Table(name="degree")
    public class Degree implements Serializable {
    @Id
    @GeneratedValue(generator="degree_id_seq",strategy=GenerationType.SEQUENCE)
    @Column(name="id")
    private int degreeId = 0;
    @Column(name="name")
    private String degreeName = "";
    public void Degree() { }
    public void setDegreeId(int degreeId) {
    this.degreeId = degreeId;
    public int getDegreeId() { return this.degreeId; }
    public void setDegreeName(String degreeName) {
    this.degreeName = degreeName;
    public String getDegreeName() { return this.degreeName; }
    }and last one .DegreeProgram.java
    package entities;
    import java.io.Serializable;
    import javax.persistence.*;
    @Entity
    @Table(name="degree_program_relationship")
    public class DegreeProgram implements Serializable{
        @Id
        @GeneratedValue
        @Column(name="id")
        private int degreeProgramId = 0;
        @ManyToOne
        @JoinColumn(name="university_id")
        private University uni;
        @ManyToOne
        @JoinColumn(name="specialization_id")
        private Specialization spec;
        @ManyToOne
        @JoinColumn(name="degree_id")
        private Degree deg;
        public void DegreeProgram() { }
        public int getDegreeProgramId() { return degreeProgramId; }
        public void setDegreeProgramId(int degreeProgramId) {
            this.degreeProgramId = degreeProgramId;
        public Degree getDeg() { return deg; }
        public void setDeg(Degree deg) { this.deg = deg; }
        public Specialization getSpec() { return spec; }
        public void setSpec(Specialization spec) { this.spec = spec; }
        public University getUni() { return uni; }
        public void setUni(University uni) { this.uni = uni; }
    }after that when i tried to run my code i got the error
    oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: The attribute [degreeProg] in entity class [class entities.University] has a mappedBy value of [uniersity] which does not exist in its owning entity class [class entities.DegreeProgram]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.Please help me. Thanks.

  • In EJB3 entities, what is the equiv. of key-cache-size for PK generation?

    We have an oracle sequence which we use to generate primary keys. This sequence is set to increment by 5.
    e.g.:
    create sequence pk_sequence increment by 5;
    This is so weblogic doesn't need to query the sequence on every entity bean creation, it only needs to query the sequence every 5 times.
    With CMP2 entity beans and automatic key generation, this was configured simply by having the following in weblogic-cmp-rdbms-jar.xml:
    <automatic-key-generation>
    <generator-type>Sequence</generator-type>
    <generator-name>pk_sequence</generator-name>
    <key-cache-size>5</key-cache-size>
    </automatic-key-generation>
    This works great, the IDs created are 10, 11, 12, 13, 14, 15, 16, etc and weblogic only needs to hit the sequence 1/5 times.
    However, we have been trying to find the equivalent with the EJB3-style JPA entities:
    We've tried
    @SequenceGenerator(name = "SW_ENTITY_SEQUENCE", sequenceName = "native(Sequence=pk_sequence, Increment=5, Allocate=5)")
    @SequenceGenerator(name = "SW_ENTITY_SEQUENCE", sequenceName = "pk_sequence", allocationSize = 5)
    But with both configurations, the autogenerated IDs are 10, 15, 20, 25, 30, etc - weblogic seems to be getting a new value from the sequence every time.
    Am i missing anything?
    We are using weblogic 10.3

    If you are having a problem it is not clear what it is from what you have said.  If you have sugestions for improving some shortcomings you see in Flash CC then you should submit them to:
    Adobe - Wishlist & Bug Report
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • JPA: Oracle Sequence Generator not up to date

    Hi,
    I'm using the JPA Oracle Sequence Generator in one of my JPA classes:
    @Entity
    @Table(name = "DACC_COST_TYPE")
    public class JPACostType implements Serializable {
    @SequenceGenerator(name = "CostTypeGenerator", sequenceName = "DACC_COST_TYPE_SEQ")
        @Column(name = "ID_COST_TYPE")
        @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CostTypeGenerator")
        private Integer idCostType;
    In order to persist a new object I perform the following code:
    @PersistenceContext
    private EntityManager em;
    JPACostType myJPA = new JPACostType();
    myJPA.setIdCostType = null;
    em.merge(myJPA);
    em.flush();
    Normally this works fine. But after deploying the app there sometimes happens an error:
    Caused by: javax.persistence.PersistenceException: SQLException while inserting entity {com.karmann.dacc.ejb.busilog.jpa.JPACostType(idCostType=4)}.
    at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.flush(PersistenceContextImpl.java:278)
    at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.beforeCompletion(PersistenceContextImpl.java:565)
    at com.sap.engine.services.orpersistence.entitymanager.EntityManagerImpl.beforeCompletion(EntityManagerImpl.java:410)
    at com.sap.engine.services.orpersistence.environment.AppJTAEnvironmentManager.beforeCompletion(AppJTAEnvironmentManager.java:197)
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:232)
    ... 52 more
    Caused by: java.sql.SQLException: ORA-00001: unique constraint (AEMA.DACC_COST_TYPE_PK) violated
    Obviously JPA does not fetch the new key by accessing the Oracle sequence. This documents "next value = 5". Does JPA fetch the new key from its cache? Is there any possibility to avoid this?
    Thanks for each hint,
    Christoph

    Hello Christoph Schäfer  ,
    I am stuck with a similar issue. I was able to save mutiple entries and there has not been much change to my JPA. I added new entities and new sequences.
    Now, I get the error Caused by: javax.persistence.PersistenceException: java.sql.SQLException: ORA-02289: Sequence ist nicht vorhanden.
    I have checked the name of sequence and sequence next val on the DB. It works on DB but when i execute it from ejb, it gives me thsi error. Now, it gives the error for all previously working JPA entities.
    I have also provided allocationSize = 1 for all entities.
    Please let me know, possible cause/solution to this issue.
    thank you.
    Regards,
    Sharath

  • JPA: Error "entity is detached" when executing a query

    Hi experts,
    I have two database tables with a foreign key constraint and generated JPA-entities for them:
    @Entity
    public class Verdeck implements Serializable {
         @EmbeddedId
         private VerdeckPK pk;
         @Column(name="ID_VERDECK")
         private String idVerdeck;
         @OneToMany(mappedBy="verdeck")
         @PersistenceContext
         private Set<Uzsb> uzsbCollection;
    @Embeddable
    public class UzsbPK implements Serializable {
         @Column(name="ID_UZSB")
         private String idUzsb;
         @Column(name="ID_PROJECT")
         private BigDecimal idProject;
    Furthermore I have a SessionBean implementing a query in one of its business methods:
    @WebMethod(operationName="getVerdeckData", exclude=false)
    public List<Verdeck> getVerdeckData (@WebParam(name="searchkey")
         BigDecimal searchkey){
         Query q = em.createQuery("SELECT v FROM Verdeck v WHERE v.pk.idProject = :searchkey")
              .setParameter("searchkey", searchkey);
              return q.getResultList();
    When calling the method via WebService-Navigator I get this error:
    "com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: The relationship >>uzsbCollection<< of entity (com.karmann.r57schraub.jpa.Verdeck(idProject=57, idIntern=v1))cannot be loaded because the entity is detached"
    (idProject / idIntern) is the composed key of "Verdeck" and (57 / v1) is a concrete value for this key in the database table.
    If required I could give you classes VerdeckPK and UzsbPK as well.
    Could you please explain what I'm doing wrong?
    Thanks for each hint,
    Christoph

    Hi Vladimir,
    thank you for this hint! Especially for the article which provides the neccessary knowledge in background.
    But using FetchType.EAGER does not solve my problem. I get a runtime error. In defaultTrace I get the following message
    SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: com.karmann.r57schraub.jpa.Verdeck@f9ac24 -> com.karmann.r57schraub.jpa.Uzsb@1f2a70 -> com.karmann.r57schraub.jpa.Verdeck@f9ac24]->com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: com.karmann.r57schraub.jpa.Verdeck@f9ac24 -> com.karmann.r57schraub.jpa.Uzsb@1f2a70 -> com.karmann.r57schraub.jpa.Verdeck@f9ac24#
    I already checked the records in my tables. There does not seem to be any cycle. Here's my test data:
    VERDECK
    ID_PROJECT    ID_INTERN     ID_VERDECK
    57                    v1                  vext1
    57                    v2                  vext2
    UZSB
    ID_PROJECT ID_UZSB ID_INTERN TYP_UZSB
    57 ls1 v1 <null>
    57 rs1 v1 <null>
    57 sd1 v1 <null>
    57 ls2 v2 <null>
    57 rs2 v2 <null>
    57 sd2 v2 <null>
    Do you have any more idea?
    Regards,
    Christoph

  • Duplicate persistence units in JPA weblogic

    Hello, I'm cross-posting thsi question from weblogic forum as a suggestion from james.bayer.
    I am using weblogic 10.3.
    I am trying to deploy a spring web application with severaljars, that contain jpa entities with a persistence.xml. The persistence unit name in all persistence.xml are equal. That is for spring no problem, because i wrote a PersistenceUnitManager, that merges all persistence units into one.
    So far so good. But weblogic cant't deploy the war, because while validation of the deployment, wls throws an exception, that there are two persistence unit with the same name.
    Does anybody has an idea how to deploy this war?
    Can i switch off the validation of the persistence.xml?
    The full stack trace is:
    weblogic.application.ModuleException: Failed to load webapp: 'sfw-poc-condicao-pagamento-web.war'
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:404)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:180)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:508)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:47)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1223)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:40)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:22)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:166)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused By: weblogic.deployment.EnvironmentException: duplicate persistence units with name sfw-persistence-unit in scope sfw-poc-condicao-pagamento-web.war. First PU location: file:/C:/java/servers/Oracle/Middleware/user_projects/domains/base_domain/servers/softway/tmp/_WL_user/sfw-poc-condicao-pagamento-web/rrg25b/war/WEB-INF/lib/sfw-class-loader-0.0.1-SNAPSHOT.jar. Second PU location: file:/C:/java/servers/Oracle/Middleware/user_projects/domains/base_domain/servers/softway/tmp/_WL_user/sfw-poc-condicao-pagamento-web/rrg25b/war/WEB-INF/lib/sfw-custom-jar-0.0.1-20100622.030351-65.jar
         at weblogic.deployment.AbstractPersistenceUnitRegistry.assertNoDuplicate(AbstractPersistenceUnitRegistry.java:313)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.processDescriptor(AbstractPersistenceUnitRegistry.java:291)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:192)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:101)
         at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
         at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1812)
         at weblogic.servlet.internal.WebAppModule.getWebClassLoader(WebAppModule.java:1604)
         at weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:2969)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:438)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:487)
         at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
         at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:381)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:180)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:508)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:47)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1223)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:40)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:22)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:166)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Thanks a lot

    They need to have different names.
    James : http://www.eclipselink.org

  • Out of memory error importing a JPA Entity in WebDynpro Project

    Hi All!
    We are having problems importing JPA entities in a WebDynPro project, this is our escenario.
    We have two entities, entity A that has a ManyToOne relationship with entity B and at the same time entity B has a OneToMany relationship with entity A. When in the controller context we try to create a node usign a model binding to Entity A we got an Out of memory error from NetWeaver DS. Trying to figure out the problem we identified that in the model that we imported we got the following.
    Entity A
        Entity B
            Entity A
               Entity B
                  and so on....... without and end
    What are we doing wrong? Or how can we avoid these behavior?
    Regards,

    Hi Kaylan:
    Thanks for your reply. You are rigth about the error that we are getting. This is our scenario.
    We have a ejb that in some of his method uses the entity Lote, and this entity has a relationship with entity Categoria. When we import the EJB using the model importer netweaver imports the EJB methods and the entities that they use.
    So after doing this besides the ejb's methods we got these two entities that are the ones that are generating the error, when we try to create a context node using the Categoria entity.
    @Entity
    @Table(name="TB_LOTE")
    public class Lote implements Serializable {
         @EmbeddedId
         private Lote.PK pk;
         @ManyToOne
         @JoinColumn(name="CO_CATEGORIALOTE")
         private Categoria coCategorialote;
         @Embeddable
         public static class PK implements Serializable {
              @Column(name="CO_LOTE")
              private String coLote;
              @Column(name="CO_ORDENFABRICACION")
              private String coOrdenfabricacion2;
                   ^ this.coOrdenfabricacion2.hashCode();
    @Entity
    @Table(name="TB_CATEGORIA")
    public class Categoria implements Serializable {
         @Id
         @Column(name="CO_CATEGORIA")
         private String coCategoria;
         @OneToMany(mappedBy="coCategorialote")
         private Set<Lote> tbLoteCollection;
    Regards,
    Jose Arango

  • JPA - Best Practice For Data Transfer?

    I've been considering an alternative method for data transfer between applications, by using Serialized or Encoded to File JPA Entities. (either Binary or XML)
    I know this procedure may have several draw backs as compared to traditional exported SQL queries or data manipulation statements, however, I want to know if anyone has considered or used this process for data transfer?
    The process would be to
    - query the database and load the JPA Entities
    - Serialize or Encode them to file
    - zip up the entire folder with the JPA entities
    - transfer the data to destination machine
    - extract the data to a temp directory
    - reload the JPA entities by de-serializing and persisting them to the database
    The reason I'm considering this process, is basically because I have a desktop application (manages member records, names, dates, contributions, etc) used by different organisations in different locations (which are not related except by purpose ie clubs or churches) and would like to have a simple way of transporting all data associated with a single profile (information about a member of the organisation) from one location to another in a simple way, ie users interact only with the application without the need for any database management tool or such.
    I'm also considering this because it is not easy to generate an SQL Script file without using a dedicated Database Management Tool, which I do not want the application users to have to learn how to use.
    I would appreciate ANY suggestions and probable alternative solutions for this problem. FYI: I'm using a Java DB database.
    ICE

    jschell wrote:
    In summary you are moving data from one database to another. True
    You only discussed flow one way. Well the process is meant to be bi-directional. Basically what I envision would to have something like:
    - the user goes to File -> Export Profile...
    - then selects one or more profiles to export
    - the export process completes and the zip archive is created and transfered (copied, mailed, etc) to the destination location
    then on the destination pc
    - the user goes to File -> Import Profile
    - selects the profile package
    - the app extracts, processes and imports the data (JPA serialized for example)
    Flow both ways is significantly more complicated in general.Well if well done it shouldn't be
    And what does this have to do with users creating anything?Well as shown above the user would be generating the Zip Archive (assuming that is the final format)
    Does this make the problem clearer?
    ICE

Maybe you are looking for

  • Network shared variables reconnecting network dropout

    I've got a cRIO unit communicating with a Laptop using Network Shared Variables, with one of them being a 21 index array that is buffered. The system connects and communicates fine, but occassionally the wireless card in the laptop is losing the sign

  • French accents on QWERTY keyboards

    Short of changing my keyboard or adopting the time-consuming methods for inserting French accents when using a QWERTY keyboard (I use them now and they slow me down enormously), is there a way to reprogram[?] some keys on my MacBook Pro so they input

  • I work in J2EE development,Could you make friend with me

    I am chinese ,live in shanghai.I eager to get know to more foreign friend,so we can share the technology.if you are agree ,please leave your MSN mail address.thanks

  • [request] VanRed

    VanRed (eVaporate and Reauthor DVDs) is an application which makes it possible to copy the main movie from a DVD to your hard disc and which allows you to remove certain audio and subtitle streams and evaporates (requant) if necessary the video strea

  • Impossible relever mail

    je ne parviens plus à relever mes mails via l'appli MAIL sur mon mcpro... je clique sur l'icône en bas de l'écran et rien ne se passe... quelqu'un peut-il m'aider svp ?