Skip to content

Commit cc31223

Browse files
committed
Re-enabled additional tests
1 parent 92e1f59 commit cc31223

File tree

7 files changed

+281
-5
lines changed

7 files changed

+281
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
55
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
66
*/
7-
package org.hibernate.test.bytecode.enhancement.lazy.group;
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.group;
88

99
import org.hibernate.annotations.LazyGroup;
1010
import org.hibernate.bytecode.enhance.spi.UnloadedClass;
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
6+
*/
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
8+
9+
import org.hibernate.annotations.LazyGroup;
10+
11+
import jakarta.persistence.CascadeType;
12+
import jakarta.persistence.Entity;
13+
import jakarta.persistence.FetchType;
14+
import jakarta.persistence.JoinColumn;
15+
import jakarta.persistence.ManyToOne;
16+
import jakarta.persistence.Table;
17+
18+
/**
19+
* @author Steve Ebersole
20+
*/
21+
@Entity(name = "Activity")
22+
@Table(name = "activity")
23+
@SuppressWarnings("WeakerAccess")
24+
public class Activity extends BaseEntity {
25+
private String description;
26+
private Instruction instruction;
27+
28+
protected WebApplication webApplication = null;
29+
30+
/**
31+
* Used by Hibernate
32+
*/
33+
@SuppressWarnings("unused")
34+
public Activity() {
35+
super();
36+
}
37+
38+
public Activity(Integer id, String description, Instruction instruction) {
39+
super( id );
40+
this.description = description;
41+
this.instruction = instruction;
42+
}
43+
44+
public String getDescription() {
45+
return description;
46+
}
47+
48+
public void setDescription(String description) {
49+
this.description = description;
50+
}
51+
52+
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
53+
@LazyGroup("Instruction")
54+
@JoinColumn(name = "Instruction_Id")
55+
public Instruction getInstruction() {
56+
return instruction;
57+
}
58+
59+
@SuppressWarnings("unused")
60+
public void setInstruction(Instruction instruction) {
61+
this.instruction = instruction;
62+
}
63+
64+
@SuppressWarnings("unused")
65+
@ManyToOne(fetch=FetchType.LAZY)
66+
@LazyGroup("webApplication")
67+
@JoinColumn(name="web_app_oid")
68+
public WebApplication getWebApplication() {
69+
return webApplication;
70+
}
71+
72+
public void setWebApplication(WebApplication webApplication) {
73+
this.webApplication = webApplication;
74+
}
75+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
6+
*/
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
8+
9+
import jakarta.persistence.Column;
10+
import jakarta.persistence.Entity;
11+
import jakarta.persistence.Id;
12+
import jakarta.persistence.Table;
13+
14+
/**
15+
* @author Steve Ebersole
16+
*/
17+
@Entity(name = "Address")
18+
@Table(name = "address")
19+
public class Address {
20+
private Integer id;
21+
22+
private String text;
23+
24+
public Address() {
25+
}
26+
27+
public Address(Integer id, String text) {
28+
this.id = id;
29+
this.text = text;
30+
}
31+
32+
@Id
33+
@Column(name = "oid")
34+
public Integer getId() {
35+
return id;
36+
}
37+
38+
public void setId(Integer id) {
39+
this.id = id;
40+
}
41+
42+
public String getText() {
43+
return text;
44+
}
45+
46+
public void setText(String text) {
47+
this.text = text;
48+
}
49+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
6+
*/
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
8+
9+
import jakarta.persistence.Column;
10+
import jakarta.persistence.Id;
11+
import jakarta.persistence.MappedSuperclass;
12+
13+
/**
14+
* @author Steve Ebersole
15+
*/
16+
@MappedSuperclass
17+
public class BaseEntity {
18+
protected Integer id;
19+
protected String nbr;
20+
21+
public BaseEntity() {
22+
}
23+
24+
public BaseEntity(Integer id) {
25+
this.id = id;
26+
}
27+
28+
@Id
29+
@Column( name = "oid" )
30+
public Integer getId() {
31+
return id;
32+
}
33+
34+
public void setId(Integer id) {
35+
this.id = id;
36+
}
37+
38+
public String getNbr() {
39+
return nbr;
40+
}
41+
42+
public void setNbr(String nbr) {
43+
this.nbr = nbr;
44+
}
45+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
6+
*/
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
8+
9+
import jakarta.persistence.Entity;
10+
import jakarta.persistence.Table;
11+
12+
/**
13+
* @author Steve Ebersole
14+
*/
15+
@Entity(name = "Instruction")
16+
@Table(name = "instruction")
17+
public class Instruction extends BaseEntity {
18+
private String summary;
19+
20+
/**
21+
* Used by Hibernate
22+
*/
23+
@SuppressWarnings("unused")
24+
public Instruction() {
25+
super();
26+
}
27+
28+
@SuppressWarnings("WeakerAccess")
29+
public Instruction(Integer id, String summary) {
30+
super( id );
31+
this.summary = summary;
32+
}
33+
34+
public String getSummary() {
35+
return summary;
36+
}
37+
38+
public void setSummary(String summary) {
39+
this.summary = summary;
40+
}
41+
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
55
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
66
*/
7-
package org.hibernate.test.bytecode.enhancement.lazy.proxy;
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
88

99
import org.hibernate.Hibernate;
1010
import org.hibernate.boot.MetadataSources;
@@ -20,9 +20,6 @@
2020
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
2121
import org.hibernate.testing.bytecode.enhancement.EnhancementOptions;
2222
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
23-
import org.hibernate.test.bytecode.enhancement.lazy.proxy.Activity;
24-
import org.hibernate.test.bytecode.enhancement.lazy.proxy.Instruction;
25-
import org.hibernate.test.bytecode.enhancement.lazy.proxy.WebApplication;
2623
import org.junit.After;
2724
import org.junit.Before;
2825
import org.junit.Test;
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
6+
*/
7+
package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
8+
9+
import java.util.HashSet;
10+
import java.util.Set;
11+
12+
import org.hibernate.annotations.LazyGroup;
13+
import org.hibernate.annotations.NaturalId;
14+
15+
import jakarta.persistence.Basic;
16+
import jakarta.persistence.Entity;
17+
import jakarta.persistence.FetchType;
18+
import jakarta.persistence.OneToMany;
19+
import jakarta.persistence.Table;
20+
21+
/**
22+
* @author Steve Ebersole
23+
*/
24+
@Entity
25+
@Table( name="web_app" )
26+
public class WebApplication extends BaseEntity {
27+
private String name;
28+
private String siteUrl;
29+
30+
private Set<Activity> activities = new HashSet<>();
31+
32+
@SuppressWarnings("unused")
33+
public WebApplication() {
34+
}
35+
36+
public WebApplication(Integer id, String siteUrl) {
37+
super( id );
38+
this.siteUrl = siteUrl;
39+
}
40+
41+
@NaturalId
42+
public String getName() {
43+
return name;
44+
}
45+
46+
public void setName(String name) {
47+
this.name = name;
48+
}
49+
50+
@Basic( fetch = FetchType.LAZY )
51+
public String getSiteUrl() {
52+
return siteUrl;
53+
}
54+
55+
public void setSiteUrl(String siteUrl) {
56+
this.siteUrl = siteUrl;
57+
}
58+
59+
@OneToMany(mappedBy="webApplication", fetch= FetchType.LAZY)
60+
@LazyGroup("app_activity_group")
61+
// @CollectionType(type="baseutil.technology.hibernate.IskvLinkedSetCollectionType")
62+
public Set<Activity> getActivities() {
63+
return activities;
64+
}
65+
66+
public void setActivities(Set<Activity> activities) {
67+
this.activities = activities;
68+
}
69+
}

0 commit comments

Comments
 (0)