Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » MappedSuperClass with EclipseLink
MappedSuperClass with EclipseLink [message #1779643] Wed, 10 January 2018 12:06 Go to next message
Eclipse UserFriend
We are trying to use @MappedSuperclass with EclipseLink 2.6.4 and SpringBoot 1.5.9 and running into an issue.

JpaBaseConfiguration
    @Override
    protected AbstractJpaVendorAdapter createJpaVendorAdapter() {

        return new EclipseLinkJpaVendorAdapter();
    }

    @Override
    public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder) {

        Map<String, Object> vendorProperties = getVendorProperties();
        customizeVendorProperties(vendorProperties);

        LocalContainerEntityManagerFactoryBean factoryBean = factoryBuilder.dataSource(getDataSource())
                .packages(getPackagesToScan()).properties(vendorProperties).jta(isJta()).build();

        factoryBean.setLoadTimeWeaver(new WebLogicLoadTimeWeaver());

        return factoryBean;
    }


Error

java.lang.NoSuchMethodError: abc.xyz.domain.shared.AbstractEntity._persistence_set(Ljava/lang/String;Ljava/lang/Object;)V
	at abc.xyz.domain.model.order.Order._persistence_set(Order.java) ~[_wl_cls_gen.jar:?]
	at org.eclipse.persistence.internal.descriptors.PersistenceObjectAttributeAccessor.setAttributeValueInObject(PersistenceObjectAttributeAccessor.java:102) ~[eclipselink.jar:2.6.4.v20160829-44060b6]
	at org.eclipse.persistence.mappings.DatabaseMapping.setAttributeValueInObject(DatabaseMapping.java:1652) ~[eclipselink.jar:2.6.4.v20160829-44060b6]
	at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1540) ~[eclipselink.jar:2.6.4.v20160829-44060b6]


The error doesn't occur when we remove the MappedSuperClass or Weaving is disabled. Any pointers on what may be missing in the configuration?
Re: MappedSuperClass with EclipseLink [message #1779903 is a reply to message #1779643] Mon, 15 January 2018 09:59 Go to previous messageGo to next message
Eclipse UserFriend
The AbstractEntity wasn't included in the weaving when it is expected to have been - try adding the class to the persistence.xml file so it can be picked up.
Re: MappedSuperClass with EclipseLink [message #1826864 is a reply to message #1779903] Sun, 03 May 2020 05:08 Go to previous messageGo to next message
Eclipse UserFriend
Is this issue resolved.?

I also face the issue with below versions of eclispeLink and JPA where the mapped super class properties are not woven and changes to those fields are not detected during peristance.

weaving : Dynamic

The default attribute change tracking : haschanges() not set to true when only mapped super class properties are changed.

The below versions of libraries

java - 8
eclipselink - 2.6.5
jpa - javax.persistance - 2.1.1
Weblogic - 12.2.1.3

[Updated on: Wed, 06 May 2020 17:05] by Moderator

Re: MappedSuperClass with EclipseLink [message #1826939 is a reply to message #1826864] Mon, 04 May 2020 20:51 Go to previous messageGo to next message
Eclipse UserFriend
Why is your class not being woven? As mentioned in my comment -this error occurs because weaving is expected to have occurred. Try adding your mapped superclass to the persistence unit xml and ensure it is with the other entity classes when using static weaving.
Re: MappedSuperClass with EclipseLink [message #1827088 is a reply to message #1826939] Wed, 06 May 2020 17:48 Go to previous messageGo to next message
Eclipse UserFriend
Added all the mapped super classes in persistance unit xml. Still AttributeChangeListener --> haschanges() returns false when change is done to only mappedsuper class attributes.(though setter).

Persistence xml version : 1

Please suggest whether any configs need to be added for dynamically weave mapped super classes.
Re: MappedSuperClass with EclipseLink [message #1827117 is a reply to message #1827088] Thu, 07 May 2020 09:21 Go to previous messageGo to next message
Eclipse UserFriend
Has it been woven? Does it have _persistence_set and other persistence method from weaving?
How are you running weaving, and what does the logging say about the class when it is occurring?

[Updated on: Thu, 07 May 2020 09:22] by Moderator

Re: MappedSuperClass with EclipseLink [message #1862454 is a reply to message #1827117] Tue, 05 December 2023 19:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I'm just wondering if a solution was found for this issue or not? We are trying to enable dynamic weaving in our application and have similar problem.
Re: MappedSuperClass with EclipseLink [message #1862471 is a reply to message #1862454] Wed, 06 December 2023 13:05 Go to previous message
Eclipse UserFriend
There is no bug I'm aware of touching this, so maybe detail your problem in a new thread as you should answer all the above questions about your issue -we can't help unless we know what you are doing and seeing.
Previous Topic:OptimisticLockException Data from Table not getting Refreshed
Next Topic:JDBC bind parameters only for one of them
Goto Forum:
  


Current Time: Thu Apr 24 23:49:20 EDT 2025

Powered by FUDForum. Page generated in 0.03507 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top