-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQL Struct with @lob (BLOB, CLOB) used as stored procedure parameter …
…type - fix (#1339) Bugfix and unit test. Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
- Loading branch information
Showing
9 changed files
with
380 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...lipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/plsql/InnerObjBlob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2021 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 implementation | ||
package org.eclipse.persistence.testing.models.jpa.plsql; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Embeddable; | ||
import javax.persistence.Lob; | ||
import org.eclipse.persistence.annotations.Struct; | ||
|
||
import java.util.Arrays; | ||
|
||
@Embeddable | ||
@Struct(name="PLSQL_P_PLSQL_INNER_BLOB_REC", fields={"BLOB_ID", "BLOB_CONTENT", "CLOB_CONTENT"}) | ||
public class InnerObjBlob { | ||
|
||
public InnerObjBlob() { | ||
} | ||
|
||
public InnerObjBlob(int blobId, byte[] blobContent, String clobContent) { | ||
this.blobId = blobId; | ||
this.blobContent = blobContent; | ||
this.clobContent = clobContent; | ||
} | ||
|
||
@Column(name="BLOB_ID") | ||
private int blobId; | ||
|
||
@Column(name="BLOB_CONTENT") | ||
@Lob | ||
private byte[] blobContent; | ||
|
||
@Column(name="CLOB_CONTENT") | ||
@Lob | ||
private String clobContent; | ||
|
||
public int getBlobId() { | ||
return blobId; | ||
} | ||
|
||
public void setBlobId(int blobId) { | ||
this.blobId = blobId; | ||
} | ||
|
||
public byte[] getBlobContent() { | ||
return blobContent; | ||
} | ||
|
||
public void setBlobContent(byte[] blobContent) { | ||
this.blobContent = blobContent; | ||
} | ||
|
||
public String getClobContent() { | ||
return clobContent; | ||
} | ||
|
||
public void setClobContent(String clobContent) { | ||
this.clobContent = clobContent; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "InnerObjBlob{" + | ||
"blobId=" + blobId + | ||
", blobContent=" + Arrays.toString(blobContent) + | ||
", clobContent='" + clobContent + '\'' + | ||
'}'; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...lipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/plsql/OuterObjBlob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2021 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 implementation | ||
package org.eclipse.persistence.testing.models.jpa.plsql; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Embeddable; | ||
import org.eclipse.persistence.annotations.Struct; | ||
|
||
@Embeddable | ||
@Struct(name="PLSQL_P_PLSQL_OUTER_STRUCT_REC", fields={"STRUCT_ID", "STRUCT_CONTENT"}) | ||
public class OuterObjBlob { | ||
|
||
public OuterObjBlob() { | ||
} | ||
|
||
public OuterObjBlob(int structId, InnerObjBlob structContent) { | ||
this.structId = structId; | ||
this.structContent = structContent; | ||
} | ||
|
||
@Column(name="STRUCT_ID") | ||
private int structId; | ||
|
||
@Column(name="STRUCT_CONTENT") | ||
private InnerObjBlob structContent; | ||
|
||
public int getStructId() { | ||
return structId; | ||
} | ||
|
||
public void setStructId(int structId) { | ||
this.structId = structId; | ||
} | ||
|
||
public InnerObjBlob getStructContent() { | ||
return structContent; | ||
} | ||
|
||
public void setStructContent(InnerObjBlob structContent) { | ||
this.structContent = structContent; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "OuterObjBBlob{" + | ||
"structId=" + structId + | ||
", structContent=" + structContent + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.