java.lang.Object
net.sf.persism.Parameters
Helper Class to represent parameters to a query.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Parameters
none()
Represents no Parameters.static Parameters
Static initializer for a new set of Parameters.static Parameters
Static initializer for named parameters.
-
Method Details
-
params
Static initializer for a new set of Parameters.Employee employee = session.fetch(Employee.class, sql("SELECT * FROM Employees WHERE LastName=? and FirstName=?"), params("Leverling", "Janet"));
- Parameters:
values
- varargs list of arbitrary parameters for a query.- Returns:
- new Parameters object
-
params
Static initializer for named parameters.List<Contact> contacts; contacts = session.query(Contact.class, where("(:firstname = @name OR :company = @name) and :lastname = @last and :city = @city and :amountOwed > @owe ORDER BY :dateAdded"), params(Map.of("name", "Fred", "last", "Flintstone", "owe", 10, "city", "Somewhere")));
- Parameters:
nameValuePair
- - use Map.of("key1", value, "key2", value) etc.- Returns:
- new Parameters object
-
none
Represents no Parameters.- Returns:
- empty array instance of Parameters
-