Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
HHH-9597 : Criteria creates invalid column aliases (test case)
(cherry picked from commit c9df758)
- Loading branch information
Showing
6 changed files
with
442 additions
and
12 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
hibernate-core/src/test/java/org/hibernate/test/criteria/Address.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,45 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* Copyright (c) 2015, Red Hat Inc. or third-party contributors as | ||
* indicated by the @author tags or express copyright attribution | ||
* statements applied by the authors. All third-party contributions are | ||
* distributed under license by Red Hat Inc. | ||
* | ||
* This copyrighted material is made available to anyone wishing to use, modify, | ||
* copy, or redistribute it subject to the terms and conditions of the GNU | ||
* Lesser General Public License, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this distribution; if not, write to: | ||
* Free Software Foundation, Inc. | ||
* 51 Franklin Street, Fifth Floor | ||
* Boston, MA 02110-1301 USA | ||
*/ | ||
package org.hibernate.test.criteria; | ||
|
||
/** | ||
* @author Gail Badner | ||
*/ | ||
public class Address { | ||
private int addressId; | ||
|
||
public int getAddressId() { | ||
return addressId; | ||
} | ||
|
||
private String addressText; | ||
|
||
public String getAddressText() { | ||
return addressText; | ||
} | ||
|
||
public void setAddressText(String addressText) { | ||
this.addressText = addressText; | ||
} | ||
} |
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
60 changes: 60 additions & 0 deletions
60
hibernate-core/src/test/java/org/hibernate/test/criteria/OrderAddress.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,60 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* Copyright (c) 2015, Red Hat Inc. or third-party contributors as | ||
* indicated by the @author tags or express copyright attribution | ||
* statements applied by the authors. All third-party contributions are | ||
* distributed under license by Red Hat Inc. | ||
* | ||
* This copyrighted material is made available to anyone wishing to use, modify, | ||
* copy, or redistribute it subject to the terms and conditions of the GNU | ||
* Lesser General Public License, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this distribution; if not, write to: | ||
* Free Software Foundation, Inc. | ||
* 51 Franklin Street, Fifth Floor | ||
* Boston, MA 02110-1301 USA | ||
*/ | ||
package org.hibernate.test.criteria; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class OrderAddress { | ||
|
||
private int orderAddressId; | ||
|
||
public int getOrderAddressId() { | ||
return orderAddressId; | ||
} | ||
|
||
private Address deliveryAddress; | ||
|
||
public Address getDeliveryAddress() { | ||
return deliveryAddress; | ||
} | ||
|
||
public void setDeliveryAddress(Address deliveryAddress) { | ||
this.deliveryAddress = deliveryAddress; | ||
} | ||
|
||
private Set<Address> notifiedAddresses = new HashSet<Address>(); | ||
|
||
public Set<Address> getNotifiedAddresses() { | ||
return notifiedAddresses; | ||
} | ||
|
||
public void setNotifiedAddresses(Set<Address> notifiedAddresses) { | ||
this.notifiedAddresses = notifiedAddresses; | ||
} | ||
|
||
public String toString() { | ||
return "" + orderAddressId + " - " + getDeliveryAddress() + " - " + getNotifiedAddresses(); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
hibernate-core/src/test/java/org/hibernate/test/criteria/OrderContact.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,56 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as | ||
* indicated by the @author tags or express copyright attribution | ||
* statements applied by the authors. All third-party contributions are | ||
* distributed under license by Red Hat Inc. | ||
* | ||
* This copyrighted material is made available to anyone wishing to use, modify, | ||
* copy, or redistribute it subject to the terms and conditions of the GNU | ||
* Lesser General Public License, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this distribution; if not, write to: | ||
* Free Software Foundation, Inc. | ||
* 51 Franklin Street, Fifth Floor | ||
* Boston, MA 02110-1301 USA | ||
*/ | ||
package org.hibernate.test.criteria; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class OrderContact { | ||
|
||
private int contactId = 0; | ||
private Set<Order> orders = new HashSet<Order>(); | ||
|
||
private String contact; | ||
|
||
|
||
public int getContactId() { | ||
return contactId; | ||
} | ||
|
||
public Set<Order> getOrders() { | ||
return orders; | ||
} | ||
|
||
public String getContact() { | ||
return contact; | ||
} | ||
|
||
public void setContact(String contact) { | ||
this.contact = contact; | ||
} | ||
|
||
public String toString() { | ||
return "[" + getContactId() + ":" + getContact() + "]"; | ||
} | ||
} |
Oops, something went wrong.