Mansour Al Akeel | 27 Sep 06:08 2014
Picon

exclude-unlisted-classes ignored

When creating EntityManagerFactory using OpenEJB,
exclude-unlisted-classes works as expected. However, when creating it
directly as in:

props.setProperty("javax.persistence.jdbc.driver", this.driver);
    props.setProperty("javax.persistence.jdbc.url", this.url);
    props.setProperty("javax.persistence.jdbc.user", this.username);
    props.setProperty("javax.persistence.jdbc.password", this.password);

    props.setProperty("javax.persistence.transactionType",
PersistenceUnitTransactionType.RESOURCE_LOCAL.name());

    EntityManagerFactory emf =
Persistence.createEntityManagerFactory(null, props);

The classes are not scanned. The only classes that are loaded and
created tables into the DB are those listed in the persistence.xml

I noticed that openejb and openjpa has their own implementation of
PersistenceUnitInfoImpl.

I just need to confirm if this is a bug, or I am missing something.

Thank you.

Mansour Al Akeel | 26 Sep 01:39 2014
Picon

Maven Plugin and schema tools

I am a bit confused about maven plugin. Trying to create tables
directly from the Entities classes.

I know it can create a schema definition and produce xml file or sql
file, but is there a way to generate and write the schema directly to
the DB ?

This functionality is not hard to add to maven plugin, but if it
exist, I prefer to use it.

The plugin I am talking about
http://mojo.codehaus.org/openjpa-maven-plugin/index.html

Thank you.

José Luis Cetina | 24 Sep 22:44 2014
Picon

ManyToMany tries to insert twice

Hi, im not sure if i have a clear concept about the Many to Many persist.

I have this scenario.

table: courses
-course_id
-description

table: documents
-docuemnt_id
-description

table: courses_documents
-course_id
-docuemnt_id

Then my entities:

public class Course{

   private int courseId;

     <at> ManyToMany(cascade = CascadeType.ALL)
     <at> JoinTable(name = "courses_documents",
            inverseJoinColumns =
                                 <at> JoinColumn(name="course_id"),
            joinColumns=
                                 <at> JoinColumn(name="document_id"))
    private Set<Document> documents;

(Continue reading)

Aron Lurie | 24 Sep 16:52 2014

Reverse mapping : table-filter?

Hi All,

Is there an equivalent feature / a way to specify to ignore certain 
tables based on a pattern in their name?

Hibernate has a "table-filter" : 
http://docs.jboss.org/tools/4.1.0.Final/en/hibernatetools/html_single/#d0e5508

My use case is ignoring the tables in Oracle that start with "BIN$" 
which are tables belonging to the recycle bin.

Thanks,
Aron

Maxim Solodovnik | 18 Sep 18:08 2014
Picon

Table name is not escaped properly (MSSql)

Hello All,

I have enum field in my class: (full source [1])
 <at> Entity
 <at> Table(name = "om_user")
public class User implements Serializable, IDataProviderEntity {
public enum Right {
Admin // access to Admin module
, Room // enter the room
, Dashboard // access the dashboard
, Login // login to Om internal DB
, Soap // use rest/soap calls
}
 <at> ElementCollection(fetch = FetchType.EAGER)
 <at> Column(name = "right")
 <at> CollectionTable(name = "om_user_right", joinColumns =  <at> JoinColumn(name =
"user_id"))
 <at> Enumerated(EnumType.STRING)
private Set<Right> rights = new HashSet<User.Right>();
}

Today we get bug report [2] according "right" is reserved word in MSSql.
Can It be escaped somehow by OpenJPA or the only option is to change column
name? (we are using OpenJPA 2.3.0)

Please NOTE table has name om_user due to "user" is reserver in derby and
it also not being escaped :(

Thanks in advance

(Continue reading)

olyalikov | 10 Sep 16:26 2014

EntityManager.find ClassCastException for wrong but existing id

Hello,

I have base entity and 2 inheritors e.g. Person and Document.
If I try to find Person entity and provide id of the Document entity I get
ClassNotFoundException but it should return either null or
EntityNotFoundException. 
If I provide just some wrong non existing id I get null.
Here is link to the maven project with test:  openjpa-find-test.zip
<http://openjpa.208410.n2.nabble.com/file/n7587085/openjpa-find-test.zip>  
Should I post a bug in issue tracker?

Thanks,
Oleg

--
View this message in context: http://openjpa.208410.n2.nabble.com/EntityManager-find-ClassCastException-for-wrong-but-existing-id-tp7587085.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

rrac | 25 Aug 15:15 2014
Picon

OpenJPA Enhancement in Play Framework

We are trying to set up Play Framework 2.3.3 with OpenJPA. We are unable 
to make Runtime or Build Time enhancement work. OpenJPA works when 
setting the RuntimeUnenhancedClasses property to supported in 
persistance.xml, but that's not recommended for production and is a 
no-go. We tried using the javaagent JVM parameter with no luck like 
this: activator -J-javaagent:lib/openjpa-all-2.3.0.jar run.

How can the enhancer be configured?

--
View this message in context: http://openjpa.208410.n2.nabble.com/OpenJPA-Enhancement-in-Play-Framework-tp7587064.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
José Luis Cetina | 19 Aug 19:26 2014
Picon

openjpa.Enhance - You have enabled runtime enhancement, but have not specified the set of persistent classes.

Hi, i have a maven project, in my project i have a maven plugin for
enhancement, when i execute the plugin i can see the "enhancement running"
lines for each entity, like this:

INFO   [main] openjpa.Tool - Enhancer running on type "class
com.xx.yy.zz.MyClassName".

But when i run my server (Apache TomEE 1.6.0) i see a warning message:

239  classpath-bootstrap  INFO   [main] openjpa.Enhance - You have enabled
runtime enhancement, but have not specified the set of persistent classes.
 OpenJPA must look for metadata for every loaded class, which might
increase class load times significantly.

If i could see that the enhancement is running when i clean and install the
pom of my maven project, then why this message is show?

Plugin:

 <!--OPENJPA ENHANCMENT-->
            <plugin>
                <groupId>org.apache.openjpa</groupId>
                <artifactId>openjpa-maven-plugin</artifactId>
                <version>${plugins.openjpa.maven.plugin}</version>
                <configuration>
                    <includes>
                        com/xx/yy/entities/**/*
                    </includes>
                    <excludes>
                        com/xx/yy/entities/**/*_.class
(Continue reading)

Manoel Pedro | 19 Aug 03:44 2014
Picon

multiple inheritance levels

Is it possible to have "multiple levels" of inheritance?
Consider: Location -> Point -> AbsolutePoint -> GeographicPoint

Using joinded inheritance the discriminator "accumulates", eg:

Relative to Location, Point has just one discriminator "PT", for
AbsolutePoint there is "ABS" relative to Point and "PT" relative to
Location. Tables and classes follow.

(thanks)

"public.loc"
----------+---------------+-----------
 loc_id   | numeric(20,0) | not null
 cat_code | character(6)  | not null
----------+---------------+-----------
"loc_pkey"        PRIMARY KEY, btree (loc_id)
"fk_loc_cat_code" FOREIGN KEY (cat_code) REFERENCES loc_cat_code(code)

"public.point"
----------+---------------+-----------
 point_id | numeric(20,0) | not null
 cat_code | character(6)  | not null
----------+---------------+-----------
"point_pkey" PRIMARY KEY, btree (point_id)
"fk_point_cat_code" FOREIGN KEY (cat_code) REFERENCES point_cat_code(code)
"point_point_id_fkey" FOREIGN KEY (point_id) REFERENCES loc(loc_id)

"public.abs_point"
-----------------------+---------------+-----------------------
(Continue reading)

Christoph Weiss | 11 Aug 20:24 2014
Picon

Container Managed EntityManager - is there a chance to control flush calls ?

Dear Community, 

We are running OpenJPa with "container managed" EntityManagers (using 
WebSphere Application Server). 
Because of technical reasons we want to explicitly control when the 
EntityManager executes the flush. 

First I thought that the parameter "FlushMode" could be a solution, but 
reading the documentation I understood it isn't.
So is there any other way to really control when the flush is executed? 

Any reply is appreciated. Thanks for your help in advance! 

Cheers
Christoph Weiss 
maurojava | 6 Aug 10:47 2014
Picon

Fetch Plain. what it is?

hi all . While i read from

http://www.slideshare.net/pinaki.poddar/jest-rest-on-openjpa
<http://www.slideshare.net/pinaki.poddar/jest-rest-on-openjpa>  

i have view that OPENJPA has Fetch Plain . 
What it is please ? 
i not know about it .

tank you .
Mauro

--
View this message in context: http://openjpa.208410.n2.nabble.com/Fetch-Plain-what-it-is-tp7587024.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Gmane