-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...2_fat/test-applications/jakartadata/src/io/openliberty/jpa/data/tests/models/Segment.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,58 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package io.openliberty.jpa.data.tests.models; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import jakarta.persistence.Embedded; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
|
||
/** | ||
* Recreate from io.openliberty.data.internal_fat_jpa | ||
* | ||
* The problem here is with the entity itself | ||
* TODO: uncomment @Entity | ||
* TODO: remove constructor from Point | ||
*/ | ||
//@Entity | ||
public class Segment { | ||
|
||
@GeneratedValue | ||
@Id | ||
public Long id; | ||
|
||
@Embedded | ||
@Column(nullable = false) | ||
public Point pointA; | ||
|
||
@Embedded | ||
@Column(nullable = false) | ||
public Point pointB; | ||
|
||
@Embeddable | ||
public static record Point(int x, int y) { | ||
/** | ||
* Recreate | ||
* Exception Description: The instance creation method [io.openliberty.jpa.data.tests.models.Segment$Point.<Default Constructor>], | ||
* with no parameters, does not exist, or is not accessible. | ||
*/ | ||
public Point() { | ||
this(0, 0); | ||
} | ||
} | ||
|
||
public static Segment of(int x1, int y1, int x2, int y2) { | ||
Segment inst = new Segment(); | ||
inst.pointA = new Point(x1, y1); | ||
inst.pointB = new Point(x2, y2); | ||
return inst; | ||
} | ||
} |
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