This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UnfetchedAttributeException when query result contains same object in…
… different layers with different plans #83
- Loading branch information
Showing
5 changed files
with
459 additions
and
0 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
92 changes: 92 additions & 0 deletions
92
eclipselink/src/test/java/test_support/entity/complex_references/Employee.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,92 @@ | ||
/* | ||
* Copyright 2021 Haulmont. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package test_support.entity.complex_references; | ||
|
||
import io.jmix.core.entity.annotation.JmixGeneratedValue; | ||
import io.jmix.core.metamodel.annotation.InstanceName; | ||
import io.jmix.core.metamodel.annotation.JmixEntity; | ||
|
||
import javax.persistence.*; | ||
import java.util.UUID; | ||
|
||
@JmixEntity | ||
@Table(name = "TEST_EMPLOYEE") | ||
@Entity(name = "test_Employee") | ||
public class Employee { | ||
|
||
@JmixGeneratedValue | ||
@Column(name = "ID", nullable = false) | ||
@Id | ||
private UUID id; | ||
|
||
@Column(name = "NAME") | ||
@InstanceName | ||
private String name; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH) | ||
@JoinColumn(name = "SUPERVISOR_ID") | ||
private Employee supervisor; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "UNIT_ID") | ||
private Unit unit; | ||
|
||
|
||
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH) | ||
@JoinColumn(name = "POSITION_ID") | ||
private Position position; | ||
|
||
public UUID getId() { | ||
return id; | ||
} | ||
|
||
public void setId(UUID id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Employee getSupervisor() { | ||
return supervisor; | ||
} | ||
|
||
public void setSupervisor(Employee supervisor) { | ||
this.supervisor = supervisor; | ||
} | ||
|
||
public Position getPosition() { | ||
return position; | ||
} | ||
|
||
public void setPosition(Position position) { | ||
this.position = position; | ||
} | ||
|
||
public Unit getUnit() { | ||
return unit; | ||
} | ||
|
||
public void setUnit(Unit unit) { | ||
this.unit = unit; | ||
} | ||
} |
Oops, something went wrong.