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.

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

  • If you traded in your mac mini for a windows pc, what would you get?

    I have a late 2009 Mac Mini and am just chafing to upgrade. It's slow as molasses.  But at the same time, I'm not willing to pay full price for 2012 model, and Apple is way behind in releasing an update. In fact I'm hearing speculation that Apple may be just discontinuing the Mac Mini.
    I don't know... But I'm getting tired of waiting. And getting a different model of Mac doens't work for me, because I want to use my own screens. (I'm running two large screens in "portrait" mode.)
    Also, I have a Windows 7 PC at work, and I've come to realize that I don't mind Windows 7 and don't see it as intrinsically better than the Apple OS. In fact Windows & has generally been mariginally more stable, and a lot faster then the OS on my Mac. In fact I got both systems around the same time and the Windows 7 system did better with less RAM and is "aging" better.
    HOWEVER, what I really love about the Mac Mini is how QUIET it is. I have it in my bedroom, next to my bed, and it's noise is barely noticeable. So I guess I should look into seeing if there area any desktop PC's that are as quiet.
    Have you considered switching back to a PC, and if you did what would you get?

    I moved away from Apple in 2007 and have never looked back !
    I use the ASRock Vision X 420D  http://www.asrock.com/nettop/Intel/VisionX%20Series%20(Haswell)/ 
    Its the same size as the current Mini but a bit taller - BUT it is FULLY user upgradeable and about the same price once you make a mini upto the same spec.
    I run Windows 8.1 on it and love it - yes there are lots of people bleating on about the 'metro' style of Win 8 but if you configure it (which has been a feature from launch, not a 3rd party hack) you never have to see the metro interface and you have a standard desktop.
    As to woodmeister50 comment of : Also, with Win8, many third party add on companies have dropped support etc. is that not the same for Mavericks ?!
    Custom mini
    ASRock Vision X 420D, 16Gb Ram, 3x 512Gb SSD, AMD Radeon R270X, WiFi (n, ac)

  • I just backed up my mac to an external hard drive using Time Machine. What would happen if I turn Time Machine off and then plug the external hard drive back into my computer?

    I just backed up my mac to an external hard drive using Time Machine. What would happen if I turn Time Machine off and then plug the external hard drive back into my computer?
    What I am ultimately wanting to do is make more room on my computer by backing up all of my files onto the external hard drive and then deleting them off of my computer. However, neededing to be able to retrieve them from the external hard drive later down the road.
    From what I have read and am trying to understand, is that I probably shouldn't have used time machine. I need to use the external hard drive like a basic flash drive where I can put things on and get things off without having it automatically update through time machine everytime I connect it to my computer.
    Not tech savvy at all and barely understand basics. I need very simple and easy to understand explanations.

    sydababy wrote:
    and then deleting them off of my computer.
    BIG BIG MISTAKE ..... youre making a linchpin deathtrap for your data trying to shove everything on a single fragile HD.
    Dont suffer the tragedy other people make, buy another or 2 more HD, theyre cheap as dust.
    The number of people who have experienced terror by having a single external HD backup is enormous.  One failure that WILL HAPPEN, and kaput,......all gone!
    Dont do it, its all about redundancy, redundancy, redundancy.
    follow here:
    Methodology to protect your data. Backups vs. Archives. Long-term data protection
    Deleting them off your computer is fine....having only ONE copy is extremely BAD.
    The Tragedy that will be, the tragedy that never should be
    Always presume correctly that your data is priceless and takes a very long time to create and often is irreplaceable. Always presume accurately that hard drives are extremely cheap, and you have no excuse not to have multiple redundant copies of your data copied on hard drives and squirreled away several places, lockboxes, safes, fireboxes, offsite and otherwise.
    Hard drives aren't prone to failure…hard drives are guaranteed to fail (the very same is true of SSD). Hard drives dont die when aged, hard drives die at any age, and peak in death when young and slowly increase in risk as they age.
    Never practice at any time for any reason the false premise and unreal sense of security in thinking your data is safe on any single external hard drive. This is never the case and has proven to be the single most common horrible tragedy of data loss that exists.
    Many 100s of millions of hours of lost work and data are lost each year due to this single common false security. This is an unnatural disaster that can avoid by making all data redundant and then redundant again. If you let a $60 additional redundant hard drive and 3 hours of copying stand between you and years of work, then you've made a fundamental mistake countless 1000s of people each year have come to regret.

  • What would happen if I were to delete the primary email address linked to my Apple ID?

    I wish to completely de-activate my @hotmail email address in order to be left with just my @icloud email address becuase I would find life more managable that way.
    I found out that I cannot change my primary @hotmail email address linked to my Apple ID with an @icloud email address as it is an active, separate Apple ID (in itself with a separate purchase / download history etc)...
    Also I am aware that separate Apple ID's cannot be merged together...
    My question is: "What would happen if I were to delete the primary email address linked to my Apple ID?"
    Would I be able to keep and use my purchases, provided they are backed up on my Mac and authorised?
    Would I be able to update those transferred purchases even though the email address linked to the apple ID in which the app was bought no longer exists?

    You can change the primary e-mail address associated with your Apple ID, so long as it isn't a mac, me or icloud email.
    http://support.apple.com/kb/HT5621
    Your Apple ID account, regardless of the primary email, can never be 'deleted', just abandoned.
    You could always just switch between the two Apple IDs as needed, to access the different purchases.

  • What would happen if I turn off my backup and delete backup data From my device? Will it delete my music and everything for ever or just stay in the cloud but not on my device?

    What would happen if I turn off my backup and delete backup data From my device? Will it delete my music and everything for ever or just stay in the cloud but not on my device?

    If you have multiple devices backing up to the Cloud, you will see all of them listed. You would click on each device to change what is backed up from that device. You can then delete your individual back-ups.
    Once you have all your settings to your liking, you can then go back to Settings>iCloud>Storage & Backup, and click on Back Up Now (bottom of the screen) to create a fresh backup with your new settings.
    Cheers,
    GB

  • HT204088 How how can I synch my ipod + iphone music to my new computer? I get the same error  "my ipod or iphone is synched with another itunes library.An Ipod can be synched with only one itunes library at a time. What would I like to do Erase and Synch

    How can I synch my ipod & iphone music (purchased from itunes on my old laptop) to my new laptop? I keep getting the same message on my itunes on my new laptop: " The ipod/Iphone is synched with another itunes library. An ipod/iphone can be synched with only one itunes library at a time. What would you like to do - Erase and Synch or Transfer Purchases?" What do I do?
    A couple of other items:
    1) I am guessing Apple does not keep a history of all my music purchases? As I did not have my entire library backed-up anywhere, and relying on the music I have on my ipod and my iphone as my only source of itunes music....I have lost over 500 songs!!!
    2) I used to have an Apple account under another account name, and since have switched to a new account name. Is there anyway to find the history of purchases from my old Apple account name and transfer these over to my new account name and onto my new laptop?
    I hope someone can help, I am having a very difficult time trying to obtain answers. Angie

    The iphone/ipod is NOT a storage/backup device.  Not maintaining a backup copy is a big mistake.
    You can transfer itunes purchases from your iphone/ipod to your computer:
    Authorize your computer for all accounts and then click  File>Transfer Purchases

  • One Accesspoint and two server...what would you suggest?

    Hello!
    I'm developing an application which handles two wireless barcodereaders. There are two computers, and one of them is connected with the accesspoint.
    The communication to and from the accesspoint is managed with an COM Component, which is used from Java.
    The barcodescanners should interact with my application , for excample if the salesman scanns a customer-ticket, the customers data should be displayed on the screen. The barcodereaders can be identified with an uniqu id, so it's no problem to know where the data came from.
    But my problem is...I'm getting all of the events to the computer which is connected with the accesspoint....
    How do I tell the other computer to display the customers data which have been scanned with the other barcodereader?
    How can I get the event handled on the other computer???
    Sockets would be a possible way, but I think that might get very complex - than i thought i could call with RMI a fireEvent Method on the 2nd computer...!?!
    What would you do to solve this problem?
    I'd be happy for your help!
    Greetings Martin G.

    Nobody out there who knows how to solve this problem?
    My main problem is how to get events which occure on on computer handled on the other computer!?!
    I'd be very happy for your help
    Greetings Martin G.

  • I want to delete my icloud-account from my iphone 5 and then register again, because I want to change my email-address/account name. What would be the steps to follow? How do I make sure I do not lose any information stored on/in my iphone 5?

    I want to delete my icloud-account from my iphone 5 and then register again, because I want to change my email-address/account name. What would be the steps to follow? How do I make sure I do not lose any information stored on/in my iphone 5?

    You would have to delete the existing iCloud account and create a wholly new one - you cannot change the @icloud.com email address of the one you already have.  To make a new one, you will also need an new AppleID as any AppleID can only have one iCloud account associated with it.
    Deleting the account will not delete anything off your device (if prompted for things like contacts, choose to keep them).  You will have to sync everything anew with the new account as you cannot move your sync'd content, your old backups or anything else from one iCloud account to another.  You will have to set up sync again and let it sync to the new account, and then make new backups to the new account as well.

  • What would happen if I wanted to replace my iPhone 3G 16GB?

    My model of the iPhone (iPhone 3G 16GB Black) has now been discontinued since the 3GS was released. Previously, when my iPhone broke I just took it to the apple store and they replaced it. However, they cannot do that anymore as they will not have my version of the iPhone to replace it with. And so I am wondering, what would they do?
    Thanks in advance.

    I was wondering the same thing with my 8Gig 3G. I bought it for $199 and now the 8 Gig is $99. Since I paid $199 and since I am paying for full coverage warranty through Best Buy if something happens to my phone that needs replacing will they give me a 3GS 16 GB since it is the same price as what I paid for mine?

  • Had a windows computer with my element 7.  Now just bought a Mac OSX   version 10.9.2 what would be the best photoshop elements for this machine.  I did download elements 12 from Apple store but kept getting incompatible message when trying to open a phot

    I thought elements were simple but maybe it is just me.  Having problems moving photos from iphoto to elements

    Duplicate post; see:
    had a windows computer with my element 7.  Now just bought a Mac OSX   version 10.9.2 what would be the best photoshop elements for this machine.  I did download elements 12 from Apple store but kept getting incompatible message when trying to open a phot

Maybe you are looking for

  • Vendor price history

    Hi folks, I am looking for a report that will provide Vendor price history for a material. Is there any standard SAP report or any  table that gives this information? Sincerely, Sanjay

  • How to pass the array as a hidden variable

    hi im trying to pass the list of employees as an array and pass it to servlet as a hidden variable and retrieve the same array in servlet can any one help me in this . urgently required.

  • Transferring SAP data to non-sap system

    Hi All, My client has non-sap CRM system. We have a requirement to pass material stock information from SAP system to non-sap CRM system. We don't need to update this information on instant basis. We require the update should happen twice or thrice a

  • Display a countdown time in a message box

    I still search for an easy way to show a 30sec realtime countdown timer in a message box. Are there any hints from your side. thanks -

  • HELP: Creating Process Chain flag

    Good Morning,     I was wondering if someone could point me into the right direction on how to create a flag on a process chain that will activate user's reports after selected cubes have loaded. I tried searching the forums but couldn't find anythin