2.2.1 bug when using COUNT and TYPE?

2013-02-05 Thread Laird Nelson
We have a JPQL query that is like this: SELECT COUNT(s.id) FROM SubsidiaryDetail s JOIN s.accountEntry a JOIN a.journalEntry j WHERE j.id = :journalEntryId AND s.amount <> 0 AND TYPE(s) NOT IN (ARSubsidiaryDetail) As you can hopefully see SubsidiaryDetail is a supertype; ARSubsidiaryDetailis a s

join-bad-col message key doesn't have corresponding message text

2013-02-01 Thread Laird Nelson
I'm getting a metadata validation error and OpenJPA 2.2.1 is attempting to tell me something I'm sure is helpful, but the message key in question ( join-bad-col) does not appear to have a related message. Here's the root error I'm getting: Caused by: org.apache.openjpa.persistence.ArgumentExcept

Re: EntityManager#createNamedQuery(String, Class) problem

2011-10-26 Thread Laird Nelson
On Tue, Oct 25, 2011 at 1:31 PM, Laird Nelson wrote: > I've got a case where I'm building a query like this: > > TypedQuery q = em.createNamedQuery("someQuery", > SomeInterface.class); > > Now, SomeInterface is not the actual entity class--that would be >

EntityManager#createNamedQuery(String, Class) problem

2011-10-25 Thread Laird Nelson
We're using OpenJPA 2.1.0. I've got a case where I'm building a query like this: TypedQuery q = em.createNamedQuery("someQuery", SomeInterface.class); Now, SomeInterface is not the actual entity class--that would be SomeInterfaceEntity (not mentioned above, as you'll note). But it is an interfa

Running PCEnhancer on a pile of classes that are not all entities

2011-09-04 Thread Laird Nelson
I wanted to verify that this ominous PCEnhancer warning: 3294 weaving WARN [main] openjpa.Enhance - Type "class > com.foobar.FoobarPropertyEditor" loaded by > org.apache.openjpa.lib.util.TemporaryClassLoader@5fd1358f has no metadata; > enhancing as persistence aware. If you intended for "class

TableGenerator: interesting unspecified behavior?

2011-08-30 Thread Laird Nelson
The JPA specification is silent on the issue of what should happen if a @TableGenerator refers to a table with no rows in it. OpenJPA does the sensible thing, which is to insert a new row, with the specified pkColumnValue and initialValue in it. Hibernate appears to do this as well. However, Ecl

OpenJPA does not read default schema from orm.xml for TableGenerator-specified sequence table

2011-08-26 Thread Laird Nelson
I have a @TableGenerator annotation that does not specify a schema: @javax.persistence.TableGenerator( name = "Fund", table = "jpa_sequence", pkColumnName = "sequence_name", valueColumnName = "last_value", pkColumnValue = "Fund", allocationSize = 500 ) I have a persistence

Re: GenerationType.TABLE question: column name suffixed with 0?

2011-08-26 Thread Laird Nelson
On Fri, Aug 26, 2011 at 1:49 PM, Laird Nelson wrote: > OpenJPA tries to read a column called "NAME0", which is not defined > anywhere. > Changing the name of the sequence table column from "NAME" to "SEQUENCE_NAME" fixed the problem. Bug in OpenJPA, I th

GenerationType.TABLE question: column name suffixed with 0?

2011-08-26 Thread Laird Nelson
I'm seeing some odd trace output in OpenJPA 2.1.0 when attempting to grab a value from a sequence table I've set up (via the @TableGeneratorannotation). I have created a table named ngp.jpa_sequence with two columns: name and last_value. name is a varchar(100); last_value is a bigint. name is th

Documentation link broken?

2011-08-17 Thread Laird Nelson
http://openjpa.apache.org/builds/apache-openjpa-2.1.1/docs/manual/manual.htmlgives me a 404. This is the link off the main Documentation page. Thought someone should know. Best, Laird -- http://about.me/lairdnelson

Quieting the "OpenJPA will not be used" warning message

2011-01-19 Thread Laird Nelson
For a whole host of unimportant reasons, we end up getting this message output by OpenJPA 2.0.0: INFO: Found persistence provider "org.hibernate.ejb.HibernatePersistence". OpenJPA will not be used. (We run unit tests against all the major JPA providers; hence sometimes other persistence providers

Default schema question (yes, I know about the Schema property)

2010-11-02 Thread Laird Nelson
I have a test suite that runs my JPA entities across all the major JPA providers. None of my entities has a schema name in it; I want to keep it that way. None of my entities are configured in any way other than annotations. I understand from the JPA specification that if I put in a element in

Re: NullPointerException regression in JDBCStoreManager 2.0.0-beta3 --> 2.0.1

2010-11-01 Thread Laird Nelson
Correction: the regression was introduced from 2.0.0-beta3 to 2.0.0. Best, Laird On Mon, Nov 1, 2010 at 3:50 PM, Laird Nelson wrote: > setInverseRelation, line 469. > > In version 2.0.0-beta3, this all worked fine. > > In version 2.0.1 any named query I create blows up with a

NullPointerException regression in JDBCStoreManager 2.0.0-beta3 --> 2.0.1

2010-11-01 Thread Laird Nelson
setInverseRelation, line 469. In version 2.0.0-beta3, this all worked fine. In version 2.0.1 any named query I create blows up with a stack like the following: FailedObject: SELECT j FROM JournalEntry j WHERE j.status <> :voidedEntry AND j.effectiveOn >= :beginOn AND j.effectiveOn <= :endOn AND

Re: NoClassDefFoundError in JavaSE environment

2010-05-12 Thread Laird Nelson
Interestingly, when I crank the logging up, and when OpenJPA is reporting its properties, it says: openjpa.RuntimeUnenhancedClasses: 0 Like I said, I have ...in my persistence.xml. Is something happening here? Thanks, Laird On Wed, May 12, 2010 at 4:00 PM, Laird Nelson wrote

NoClassDefFoundError in JavaSE environment

2010-05-12 Thread Laird Nelson
I'm getting an odd NoClassDefFoundError while running unit tests in a standard Java SE environment. I'm on Java 6 with OpenJPA 2.0.0-beta3. I have an AbstractType class that is a @MappedSuperclass. It is in one jar file. It contains, among other things, an @Id mapping, and a couple of straightfo

Bug involving XMLSchemaSerializer and DBIdentifiers

2010-02-25 Thread Laird Nelson
Bug filed: https://issues.apache.org/jira/browse/OPENJPA-1540 Best, Laird

Bug in InformixDictionary: column ids come back with quotes

2010-02-25 Thread Laird Nelson
I'd like to confirm another bug in the InformixDictionary that cropped up sometime between 1.2.2 and 2.0 beta. If you ask the InformixDictionary to find a table's imported keys via its getImportedKeys() method ( http://openjpa.apache.org/builds/latest/docs/javadoc/org/apache/openjpa/jdbc/sql/DBDic

XMLSchemaSerializer outputs double quotes

2010-02-24 Thread Laird Nelson
I'm in the process of upgrading my OpenJPA-based tools from OpenJPA 1.2.2 to 2.0. It is extremely painful and full of all sorts of backwards incompatibilities. Once I have rebuilt my code to account for the API changes (mostly in the area of DBIdentifiers), I now find that schemas are being seria

Re: clone() contract broken for JDBCConfigurationImpl instances

2010-02-24 Thread Laird Nelson
don't know what other properties don't "make it" during a clone. Laird On Wed, Feb 24, 2010 at 3:18 PM, Laird Nelson wrote: > Hello; JDBCConfigurationImpl, when cloned, drops its passwords on the > floor. > > This did not happen in version 1.2.2. > > The pr

clone() contract broken for JDBCConfigurationImpl instances

2010-02-24 Thread Laird Nelson
Hello; JDBCConfigurationImpl, when cloned, drops its passwords on the floor. This did not happen in version 1.2.2. The problem is related to the introduction of the EncryptionProvider in the 2.0 line (and others). The bug is here: https://issues.apache.org/jira/browse/OPENJPA-1534 This is a sho

Should DBDictionary instances call Column#setAutoAssigned(true)?

2010-02-12 Thread Laird Nelson
I've noticed that none of the DBDictionary instances that ship with OpenJPA call Column#setAutoAssigned(true), even when it is within their power to do so. Is this by design? Does this decision logically lie elsewhere? Thanks, Laird

Datastore identity and ReverseMappingTool

2010-02-12 Thread Laird Nelson
I am baffled at the output of the ReverseMappingTool in OpenJPA 1.2.2 when it comes to datastore identity. Perhaps I am missing what datastore identity is. I had assumed that a class conceptually has datastore identity when it has, for example, an auto-assigned primary key. In such a case I'd ex

clone() methods in the codebase--bizarre implementations?

2010-02-05 Thread Laird Nelson
Hi; I'm trying to understand the rationale of some of the implementations of Cloneable in the OpenJPA codebase. Take, for example, the clone() method in SchemaGroup.java, and its helper methods: public Object clone() { SchemaGroup clone = newInstance(); clone.copy(this);

SchemaGenerator vs. SchemaFactory

2010-02-01 Thread Laird Nelson
Can someone outline for me what the difference is between these two classes (other than that SchemaGroup is a class and SchemaFactory is an interface)? To my eyes they are responsible for the same job. It also seems like a SchemaGenerator should, in all cases, be a SchemaFactory. Suppose I'm wri

Getting META-INF/persistence.xml read?

2010-01-27 Thread Laird Nelson
I'm creating a tool that uses the JDBCConfigurationImpl() class. I was under the impression that somehow this class is capable of finding the META-INF/persistence.xml file if it is present on the classpath, thus setting things like the database user name, the password, the connection url, and so f

AnnotationPersistenceMappingSerializer question

2009-12-10 Thread Laird Nelson
I'm looking at the 1.3.x branch. In AnnotationPersistenceMappingSerializer.java, line 510, when the serializer begins its work of recording annotation information for columns, it does so by consulting the FieldMapping's getMappingInfo().getColumns() method. OK; fine; push that on the mental stack

MappedSuperclasses?

2009-12-07 Thread Laird Nelson
Hello; I asked this question before and got crickets. What is the best way to customize a ReverseMappingTool run such that for every table mapped I create a MappedSuperclass that it inherits from? I am using OpenJPA 1.2.1 and generating annotations, not XML. So if I have a database table named P

Question regarding -properties option of ReverseMappingTool

2009-11-23 Thread Laird Nelson
The documentation for ReverseMappingTool says that the -properties command line option can take a file path or a resource name. I can get this to work if I give a file path, but not if I give a resource name. Assume I'm in the C:\crap directory. If I specify this: -properties C:\crap\META-INF\o

Maven dependencies in 1.3.0-SNAPSHOT

2009-10-31 Thread Laird Nelson
Perhaps it's just me, but I noticed that all of a sudden dependencies like commons-lang and serp are not being pulled down when I depend on openjpa (I cleaned my local repository of OpenJPA artifacts, and after rebuilding, my build fails, saying that it cannot find classes that would be present if

ReverseMappingTool: easiest way to produce @MappedSuperclasses?

2009-10-23 Thread Laird Nelson
Where in the customize(ClassMapping) method of ReverseCustomizer would I set something that would let the code generators downstream know that they should generate mapped superclasses instead of entities? Would I install a different ClassStrategy on the mapping? Thanks, Laird

Re: Deducing a primary key, customizing in ReverseCustomizer?

2009-10-22 Thread Laird Nelson
On Thu, Oct 22, 2009 at 10:33 AM, Laird Nelson wrote: > Before I begin the long, slow process of understanding these hundreds of > methods, does anyone know if at customize(FieldMapping)-time I have access > to: > * The names of unique indices found so far (I presume yes) > *

Deducing a primary key, customizing in ReverseCustomizer?

2009-10-22 Thread Laird Nelson
Before I spend a lot of time going down the wrong path, I thought I'd ask the (rather silent these days?) users list what the best approach is. I work for a company that has a 30 year old database that chose for all sorts of reasons to have many of its tables defined without primary keys. Of any k

ReverseMappingTool: can I turn off the generation of orm.xml?

2009-10-21 Thread Laird Nelson
I was unable to figure out from the documentation here () how to turn off the generation of the orm.xml file. I don't actually care, but there seems to be a bug in the tool. If I run the mapper twice, it appears that the orm.xml file's being present on the second run causes the tool to crash. I'

ReverseCustomizer question

2009-10-05 Thread Laird Nelson
Is it possible to have a ReverseCustomizer generate two classes? Specifically, for my day job this time, I'm required to generate a @MappedSuperclass and an empty JPA entity skeleton that extends it. I would love it if we could make use of an existing tool--like OpenJPA's ReverseMappingTool--to d

Re: Cascading problem...bug?

2009-10-04 Thread Laird Nelson
I have altered the Maven project locally to use Hibernate instead and it runs the test case with no problems in exactly the way that I would expect. I'll try it with EclipseLink next. If that succeeds as well, I'll file a bug. Best, Laird On Sat, Oct 3, 2009 at 1:03 PM, Laird Nel

Cascading problem...bug?

2009-10-03 Thread Laird Nelson
I've attached a simple maven project that demonstrates what might be a bug in the way that OpenJPA handles cascading. However I freely admit of the strong possibility that instead I'm just being stupid. That's why I'm coming to the user list first. Please find attached a JPA project that describ

Cascade and persist issues

2009-10-01 Thread Laird Nelson
On a field marked @OneToMany(/*...*/ cascade = CascadeType.ALL), I am getting this error at persist() time: org.apache.openjpa.persistence.ArgumentException: Encountered new object in persistent field "blox.party.jpa.PartyEntity.postalAddresses" during attach. However, this field does not allow

Mapping question regarding @SecondaryTable

2009-08-26 Thread Laird Nelson
I have a legacy mapping question. I have a table called id_rec (this is from a 30 year old database). It stores, basically, a row for just about every single thing in the system. I have another table called profile_rec. It stores, roughly, person-related data, and has a foreign key back to the

insertable/updatable = false question

2009-08-13 Thread Laird Nelson
I have an entity, E2, that contains a many-to-one relationship with E1 like this: // assume E1's primary key column is x @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "x", referencedColumnName = "x", insertable = false, updatable = false) private E1 e1; Then in E2 I also have a field like

OPENJPA-1001

2009-08-13 Thread Laird Nelson
Hello, I'm encountering this bug, but with a different stack than the one reported in https://cwiki.apache.org/jira/browse/OPENJPA-1001. I'm using OpenJPA 1.3.0-SNAPSHOT and am accessing it through OpenEJB. I will attempt to reproduce this bug with a simpler test case than the one I'm currently r

Odd use case

2009-07-10 Thread Laird Nelson
Hello, folks; OpenJPA has impressed me so far for thinking in most cases waaay ahead of the curve. I'm hoping that perhaps this use case is handled natively. I am mapping a 30-year-old relational schema by hand (since it has no foreign key or primary key information). One of the cases I've run a

Define index?

2009-07-09 Thread Laird Nelson
Is it possible to define a non-unique index in OpenJPA? Hibernate offers the @Index annotation to do this as part of its DDL generation machinery. My apologies if this was mentioned; I didn't see it in http://openjpa.apache.org/builds/latest/docs/manual/manual.html. Thanks, Laird

JoinColumn: match its length to the referenced column?

2009-07-08 Thread Laird Nelson
One more bug confirmation for today: when generating DDL, I am noticing that OpenJPA does not match the length or type of a JoinColumn to its referenced column. That is, suppose the referenced column is defined like this: @Column(name = "title", length = 4, columnDefinition = "CHAR(4)") ...and in

Bug confirmation? Cannot have more than one unique column

2009-07-08 Thread Laird Nelson
I wanted to confirm this bug here before I recorded it. If I have two columns in my entity that are both marked @Column( ... unique = true), then the DDL generation machinery of OpenJPA attempts to create two unique constraints, one for each column--so far so good--but with the same constraint nam

Need to list embeddable classes in persistence.xml?

2009-06-11 Thread Laird Nelson
Hello. I've found that OpenJPA needs me to list my @Embeddable classes in persistence.xml as well as my @Entity classes. This is not needed by Hibernate or EclipseLink. I couldn't find a relevant section of the specification that addresses this. Is this a bug or just a minor annoyance? I'm try

Re: OPENJPA_SEQUENCE_TABLE: needed even with IDENTITY columns?

2009-04-19 Thread Laird Nelson
On Sun, Apr 19, 2009 at 3:41 AM, Paul Copeland (via Nabble) < ml-user+196740-2043936...@n2.nabble.com > wrote: > I noticed that |GenerationType.SEQUENCE also uses that table (with > Postgres provider). Maybe you have one of those on some Entity.| > Nope; I sure do not. :-( Best, Laird