Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] ClassWeaver refresh #2049

Merged
merged 4 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ public static StaticWeaveException exceptionPerformWeaving(Exception cause, Obje
return loadingException;
}


public String getResourceName(){
return resourceName;
}
Expand Down
25 changes: 24 additions & 1 deletion jpa/eclipselink.jpa.testapps/jpa.test.weaving/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -33,9 +33,20 @@

<build>
<resources>
<resource>
<directory>src/main/resources/META-INF</directory>
<filtering>true</filtering>
<includes>
<include>persistence.xml</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
<plugins>
Expand Down Expand Up @@ -99,6 +110,12 @@
</classpathDependencyExcludes>
<systemPropertyVariables>
<eclipselink.asm.service>eclipselink</eclipselink.asm.service>
<!--Following system properties must be initialized again as systemPropertyVariables reset environment.-->
<db.driver>${db.driver}</db.driver>
<db.url>${db.url}</db.url>
<db.user>${db.user}</db.user>
<db.pwd>${db.pwd}</db.pwd>
<db.platform>${db.platform}</db.platform>
</systemPropertyVariables>
</configuration>
</execution>
Expand All @@ -110,6 +127,12 @@
<configuration>
<systemPropertyVariables>
<eclipselink.asm.service>ow2</eclipselink.asm.service>
<!--Following system properties must be initialized again as systemPropertyVariables reset environment.-->
<db.driver>${db.driver}</db.driver>
<db.url>${db.url}</db.url>
<db.user>${db.user}</db.user>
<db.pwd>${db.pwd}</db.pwd>
<db.platform>${db.platform}</db.platform>
</systemPropertyVariables>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.eclipse.persistence.asm</classpathDependencyExclude>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.

SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause

-->

<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="weaving-dir-test-pu" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>org.eclipse.persistence.testing.models.jpa.weaving.WeavingEntityInDir</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.level" value="${eclipselink.logging.level}"/>
<property name="eclipselink.logging.level.sql" value="${eclipselink.logging.sql.level}"/>
<property name="eclipselink.logging.parameters" value="${eclipselink.logging.parameters}"/>
<property name="eclipse.weaving" value="static"/>
</properties>
</persistence-unit>
</persistence>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/

// Contributors:
// Oracle - initial API and implementation
package org.eclipse.persistence.testing.models.jpa.weaving;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

public class WeavingChangeListener implements PropertyChangeListener {

private boolean listenerInvoked = false;

@Override
public void propertyChange(PropertyChangeEvent evt) {
listenerInvoked = true;
}

public boolean isListenerInvoked() {
return listenerInvoked;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/*
* Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/

// Contributors:
// Oracle - initial API and implementation
package org.eclipse.persistence.testing.models.jpa.weaving;

import jakarta.persistence.Basic;
import jakarta.persistence.Cacheable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import org.eclipse.persistence.annotations.FetchAttribute;
import org.eclipse.persistence.annotations.FetchGroup;

@Entity
@FetchGroup(name="FloatingPointFieldsOnly",
attributes={
@FetchAttribute(name="floatField"),
@FetchAttribute(name="doubleField")})
@Cacheable(false)
public class WeavingEntityInDir {
private int id;
private boolean booleanField;
private byte byteField;
private short shortField;
private int intField;
private long longField;
private float floatField;
private double doubleField;
private String stringField;
private byte[] blobField;

public WeavingEntityInDir() {
}

public WeavingEntityInDir(int id) {
this.id = id;
}

@Id
public int getId() {
return this.id;
}

public void setId(int id) {
this.id = id;
}

public boolean isBooleanField() {
return booleanField;
}

public void setBooleanField(boolean booleanField) {
this.booleanField = booleanField;
}

public byte getByteField() {
return byteField;
}

public void setByteField(byte byteField) {
this.byteField = byteField;
}

public short getShortField() {
return shortField;
}

public void setShortField(short shortFiled) {
this.shortField = shortFiled;
}

public int getIntField() {
return intField;
}

public void setIntField(int intField) {
this.intField = intField;
}

public long getLongField() {
return longField;
}

public void setLongField(long longField) {
this.longField = longField;
}

public float getFloatField() {
return floatField;
}

public void setFloatField(float floatField) {
this.floatField = floatField;
}

public double getDoubleField() {
return doubleField;
}

public void setDoubleField(double doubleField) {
this.doubleField = doubleField;
}

public String getStringField() {
return stringField;
}

public void setStringField(String stringField) {
this.stringField = stringField;
}

@Lob
@Column(length=4800)
@Basic(fetch= FetchType.LAZY)
public byte[] getBlobField() {
return blobField;
}

public void setBlobField(byte[] blobField) {
this.blobField = blobField;
}
}
Loading
Loading