testOrderBy2() Find the reservations ordered by their amountPaid.
public void
testOrderByDescAsc() Find all the customers ordered by their lastname (desc) and firstname (asc).
public void
testSeries1() The execution of those two tests failed.
public void
testSimpleMemberOf() Finding the customer with a specific phone number
SELECT OBJECT(c) FROM jt2_Customer cust WHERE ?1 IS MEMBER OF cust.phoneNumbers
This test is done via a session bean because it need to use Local interfaces.
public void
testSimpleOrderBy() Find all the customers ordered by their lastname.
Get all the cities of addresses
SELECT a.city FROM jt2_Address AS a
testAddrGetAllCreditCompanies
public void testAddrGetAllCreditCompanies() throws Exception(Code)
Get all the creditCompanies of addresses
SELECT a.creditCompany FROM jt2_Address AS a
testAddrGetAllCreditCompanyIds
public void testAddrGetAllCreditCompanyIds() throws Exception(Code)
Get all the creditCompany id of addresses.
This is a test about Null Values in the Query Result.
If the result of the query corresponds to a cmp-field not defined in term of java primitive type,
the container must include null value in the result.
See the EJB Specification version 2.1, chapter 11.2.7.1
SELECT a.creditCompany.id FROM jt2_Address AS a
(bug #301174)
testAddrGetAllCreditCompanyNames
public void testAddrGetAllCreditCompanyNames() throws Exception(Code)
Get all the creditCompany names of addresses.
This is a test about Null Values in the Query Result.
If the result of the query corresponds to a cmr-field or cmp-field not defined in term of java primitive type,
the container must include null value in the result.
See the EJB Specification version 2.1, chapter 11.2.7.1
SELECT a.creditCompany.name FROM jt2_Address AS a
(bug #3001174)
testAddrGetAllCreditCompanyNums
public void testAddrGetAllCreditCompanyNums() throws Exception(Code)
Get all the creditCompany id of addresses.
This is a test about Null Values in the Query Result.
If the result of the query corresponds to a cmp-field defined in term of java primitive type,
the container must not include null value in the result.
See the EJB Specification version 2.1, chapter 11.2.7.1
SELECT a.creditCompany.num FROM jt2_Address AS a
(bug #301174)
Bug #300626
SELECT OBJECT(a) FROM jt2_Address AS a
WHERE a.homecustomer.lastName = 'Smith80'
AND a.homecustomer.creditCard.id = 10
AND a.homecustomer.creditCard.creditCompany.name = 'CETELEM'
AND a.homecustomer.creditCard.creditCompany.id = 10
testAmountOfReservationsForCustomer
public void testAmountOfReservationsForCustomer() throws Exception(Code)
Get the amount paid of all the reservations for a specific customer.
SELECT SUM(r.amountPaid) FROM jt2_Reservation AS r WHERE ?1 MEMBER OF r.customers
(bug #300280)
Finding Customers having City = Minneapolis and STATE= MN
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.homeAddress.city = ?1 AND c.homeAddress.state = ?2
Select the address of a customer
An ejbSelect with a local bean as result
SELECT c.homeAddress FROM jt2_Customer AS c WHERE c.id = ?1
testCustEjbSelectAddrCity
public void testCustEjbSelectAddrCity() throws Exception(Code)
Select the city of the address of a customer
SELECT c.homeAddress.city FROM jt2_Customer AS c WHERE c.id = ?1
testCustEjbSelectAllCreditCartAddr
public void testCustEjbSelectAllCreditCartAddr() throws Exception(Code)
Select the addresses of the company of the credit card of all the customers.
An ejbSelect with a collection of local bean as result
SELECT c.creditCard.creditCompany.address FROM jt2_Customer c
testCustEjbSelectDistinctFirstName
public void testCustEjbSelectDistinctFirstName() throws Exception(Code)
Select the DISTINCT firstName of all the customers.
SELECT DISTINCT c.firstName FROM jt2_Customer AS c
testCustEjbSelectFirstName
public void testCustEjbSelectFirstName() throws Exception(Code)
Select the firstName of all the customers.
SELECT c.firstName FROM jt2_Customer AS c
testCustEjbSelectLastName
public void testCustEjbSelectLastName() throws Exception(Code)
Select the lastName of a customer
SELECT c.lastName FROM jt2_Customer AS c WHERE c.id = ?1
testCustEjbSelectRogerAddr
public void testCustEjbSelectRogerAddr() throws Exception(Code)
Select the adresses of all 'roger' customers.
An ejbSelect with a collection of local bean as result
SELECT c.homeAddress FROM jt2_Customer c WHERE c.firstName = 'Roger'
Get the customer with a given id
SELECT c FROM jt2_Customer AS c WHERE c.id = ?1
testCustomersCountCreditCard
public void testCustomersCountCreditCard() throws Exception(Code)
Get the count of credit card for customers
SELECT COUNT(c.creditCard) FROM jt2_Customer AS c
The result must be equivalent to
SELECT COUNT(c.creditCard) FROM jt2_Customer AS c WHERE c.creditCard IS NOT NULL
testCustomersCreditCardNumbers
public void testCustomersCreditCardNumbers() throws Exception(Code)
Get the list of the number of the credit card for customers
SELECT DISTINCT c.creditCard.number FROM jt2_Customer AS c ORDER BY c.creditCard.number
Finding all Customer with reservations (there will not be duplication in result)
SELECT DISTINCT OBJECT(c) FROM jt2_Reservation res, IN(res.customers) c
Test a finder method
- which have no parameter and which have its name starts with 'findAll',
- but which not means "findAll".
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.firstName LIKE 'Mike'
Finding All Customer
SELECT OBJECT(c) FROM jt2_Customer AS c
testFindResWithLesserAmount
public void testFindResWithLesserAmount() throws Exception(Code)
Find the reservations with lesser amount.
SELECT DISTINCT OBJECT(r1) FROM jt2_Reservation AS r1, jt2_Reservation AS r2
WHERE r1.amountPaid < r2.amountPaid AND r2.id = 26
Finding all Customer with reservations (there will be duplication in result if customer has more than one reservation
SELECT OBJECT(c) FROM jt2_Reservation res, IN(res.customers) c
Finding Customers Without Reservations and with good credit
SELECT OBJECT(c) FROM jt2_Customer c
WHERE c.reservations IS EMPTY AND c.hasGoodCredit = true
Finding Customers Without Reservations and with good credit
Test equivalent to testIsEmptyInExp1
SELECT OBJECT(c) FROM jt2_Customer c
WHERE NOT (c.reservations IS NOT EMPTY OR c.hasGoodCredit <> true)
Finding Customers Without Reservations and with good credit
Test equivalent to testIsEmptyInExp1
SELECT OBJECT(c) FROM jt2_Customer c
WHERE NOT (c.hasGoodCredit <> true) AND c.reservations IS EMPTY
Finding Customers Without Reservations and with good credit
Test equivalent to testIsEmptyInExp1
SELECT OBJECT(c) FROM jt2_Customer c
WHERE NOT ( NOT (c.reservations IS EMPTY AND c.hasGoodCredit = true) )
Test to reproduce bug #300525
Finding Customers Without Reservations OR with good credit
SELECT OBJECT(c) FROM jt2_Customer c
WHERE c.reservations IS EMPTY OR c.hasGoodCredit == true
Test to reproduce bug #300525
Finding Customers Without or With Reservations (equivalent to finding all customers)
SELECT OBJECT(c) FROM jt2_Customer c
WHERE c.reservations IS EMPTY OR c.reservations IS NOT EMPTY
Test a finder method with the IS NULL operator on a cmr field in an expression.
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.firstName = ?1 AND c.creditCard IS NULL
Test a finder method with the IS NOT NULL operator on a cmr field with a complex navigation.
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.creditCard.creditCompany IS NOT NULL
Finding Customers On Alaska Cruise
SELECT OBJECT(c) FROM jt2_Customer cust, Cruise cr, IN(cr.reservations) res
WHERE cr = ?1 AND cust MEMBER OF res.customers
(Bug #300635)
Get the min value of the amount of the reservations for the cruise name.
SELECT MIN(r.amountPaid) FROM jt2_Reservations AS r WHERE r.cruise.name = ?1
testMinAmountOfReservations
public void testMinAmountOfReservations() throws Exception(Code)
Get the min value of the amount of the reservations.
SELECT MIN(r.amountPaid) FROM jt2_Reservations AS r
(Bug #300634)
Finding Customers having a name not like 'Jo%' OR not like 'S%'
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.lastName NOT LIKE ?1 OR c.firstName NOT LIKE ?2
Find the reservations ordered by their amountPaid.
The DISTINCT aggregate is used to reproduce the bug #300527
SELECT DISTINCT OBJECT(r) FROM jt2_Reservation AS r ORDER BY r.amountPaid
(bug #300527)
Find all the customers ordered by their lastname (desc) and firstname (asc).
SELECT OBJECT(c) FROM jt2_Customer c ORDER BY c.lastName DESC, c.firstName ASC
Finding the customer with a specific phone number
SELECT OBJECT(c) FROM jt2_Customer cust WHERE ?1 IS MEMBER OF cust.phoneNumbers
This test is done via a session bean because it need to use Local interfaces.
Finding Customer having a name exactly matching 'Joe Star' &
Finding Customers having a name like 'Jo S' (no wildcards) &
Finding Customers having a name like 'Jo% S%' (with wildcards)
Finding Customers having a name like 'Jo% S%' and living in MN
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.lastName = ?1 AND c.firstName = ?2 &
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.lastName LIKE ?1 AND c.firstName LIKE ?2 &
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.lastName LIKE ?1 AND c.firstName LIKE ?2
SELECT OBJECT(c) FROM jt2_Customer c WHERE c.lastName LIKE ?1 AND c.firstName LIKE ?2 AND c.homeAddress.state = ?3
Fields inherited from org.objectweb.jonas.jtests.clients.entity.A_Cmp2Util