An Internal Error Occurred Accessing The Primary Key Object 202
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums Mailing Lists Wiki IRC How to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term Support PolarSys Science OpenMDM Toggle navigation Home Projects Forums Eclipse Community Forums Forum Search: Search Help Register Login Home Home» Eclipse Projects» EclipseLink» Composite Key Configuration using Dynamic Eclipse Link API Show: Today's Messages :: Show Polls :: Message Navigator Composite Key Configuration using Dynamic Eclipse Link API [message #784225] Fri, 27 January 2012 08:08 Nabeel AhmedMessages: 20Registered: January 2012 Junior Member I m try to configure a Dynamic Type which have composite primary key, but i am having a problem in its configuration. /* * Configuring ProductKey */ JPADynamicTypeBuilder productKeyTypeBuilder = new JPADynamicTypeBuilder(classLoader.createDynamicClass(packageName + "ProductKey"), null); productKeyTypeBuilder.addDirectMapping("ProductID", int.class,"ProductID"); productKeyTypeBuilder.addDirectMapping("ProductName", String.class, "ProductName"); /* * Configuring Products */ JPADynamicTypeBuilder productTypeBuilder = new JPADynamicTypeBuilder(classLoader.createDynamicClass(packageName + "Products"), null, "Products"); productTypeBuilder.addDirectMapping("QuantityPerUnit", String.class,"QuantityPerUnit"); productTypeBuilder.addDirectMapping("UnitPrice", Double.class, "UnitPrice"); productTypeBuilder.addDirectMapping("UnitsInStock", Short.class, "UnitsInStock"); productTypeBuilder.addDirectMapping("UnitsOnOrder", Short.class, "UnitsOnOrder"); productTypeBuilder.addDirectMapping("ReorderLevel", Short.class, "ReorderLevel"); productTypeBuilder.addDirectMapping("Discontinued", Boolean.class, "Discontinued"); AggregateObjectMapping aom = productTypeBuilder.addAggregateObjectMapping("ProductKey", productKeyTypeBuilder.getType(), true); aom.setIsPrimaryKeyMapping(true); aom.setIsReadOnly(false); and i m getting errors in it. am i missing anything? any help? Report message to a moderator Re: Composite Key Configuration using Dynamic Eclipse Link API [message #786491 is a reply to message #784225] Mon, 30 January 2012 13:52 Nabeel AhmedMessages: 20Registered: January 2012 Junior Member I m still facing this problem, please help me in this regard R
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users https://www.eclipse.org/forums/index.php/t/279854/ Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Problem with ManyToMany and JPA EclipseLink up vote 2 down vote favorite http://stackoverflow.com/questions/4156074/problem-with-manytomany-and-jpa-eclipselink I've got a ManyToMany Relationship with composite key between a User and a Group in JPA EclipseLink. My Implementation looks like that: User Class: @Entity @Table(name="mbm_user") public class User extends CanAccessBook{ @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(nullable = false) private Long id; @OneToMany(mappedBy="user",cascade=CascadeType.PERSIST) private List
us Login or Register https://github.com/dmatej/Glassfish/blob/master/v2/entity-persistence/src/java/oracle/toplink/essentials/exceptions/i18n/DescriptorExceptionResource.java ASK A QUESTION QuestionsBadgesCategoriesTagsUsers ©2016 site design / logo © 2015 qaoverflow.com; user contributions licensed under cc by-sa 3.0 with attribution required an internal Terms & Privacy Home getIdentifier method of PersistenceUnitUtil not working for Composite keys 0 I am getting below error when trying to retrieve identity using getIdentifier method of an internal error PersistenceUnitUtil. Is there anything I am doing wrong.Local Exception Stack: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DescriptorException Exception Description: An internal error occurred accessing the primary key object [202]. Internal Exception: java.lang.NullPointerException Descriptor: RelationalDescriptor(com.sample.Person --> [DatabaseTable(PERSON)]) at org.eclipse.persistence.exceptions.DescriptorException.errorUsingPrimaryKey(DescriptorException.java:1923) at org.eclipse.persistence.internal.jpa.CMP3Policy$FieldAccessor.setValue(CMP3Policy.java:686) at org.eclipse.persistence.descriptors.CMPPolicy.createPrimaryKeyInstance(CMPPolicy.java:453) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getIdentifier(EntityManagerFactoryImpl.java:75) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getIdentifier(EntityManagerFactoryDelegate.java:679) at com.sample.PersistenceUtil.getEntityIdentifier(PersistenceUtil.java:27) at com.sample.PersistenceUtil.getEntityIdentifier(PersistenceUtil.java:18) at com.sample.OverrideUtilTest.canconfirmEntityEqualsforCompositeId2(OverrideUtilTest.java:147) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.jun
Support Search GitHub This repository Watch 1 Star 6 Fork 3 dmatej/Glassfish Code Pull requests 0 Projects 0 Wiki Pulse Graphs Permalink Branch: master Switch branches/tags Branches Tags branch-dmatej-4.1 branch-dmatej-master branch-v4.1 master Nothing to show 4.1 Nothing to show Find file Copy path Glassfish/v2/entity-persistence/src/java/oracle/toplink/essentials/exceptions/i18n/DescriptorExceptionResource.java Fetching contributors… Cannot retrieve contributors at this time Raw Blame History 248 lines (241 sloc) 28.8 KB /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * // Copyright (c) 1998, 2007, Oracle. All rights reserved. * * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file u