| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE hibernate-mapping
- PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
- <!--
- iEat Hibernate queries for MySQL
- -->
- <hibernate-mapping>
-
- <query name="BaseAll">
- <![CDATA[from magoffin.matt.ieat.domain.Base base order by lower(base.Value) asc]]>
- </query>
- <query name="CourseAll">
- <![CDATA[from magoffin.matt.ieat.domain.Course course order by lower(course.Value) asc]]>
- </query>
- <query name="DifficultyAll">
- <![CDATA[from magoffin.matt.ieat.domain.Difficulty difficulty order by difficulty.id asc]]>
- </query>
- <query name="EthnicityAll">
- <![CDATA[from magoffin.matt.ieat.domain.Ethnicity ethnicity order by lower(ethnicity.Value) asc]]>
- </query>
- <query name="IngredientAll">
- <![CDATA[from magoffin.matt.ieat.domain.Ingredient ingredient order by lower(ingredient.Name) asc]]>
- </query>
- <query name="MealsForUser">
- <![CDATA[from magoffin.matt.ieat.domain.Meal meal where meal.Owner.id = ? order by lower(meal.Name) asc]]>
- </query>
- <query name="PrepTimeAll">
- <![CDATA[from magoffin.matt.ieat.domain.PrepTime prep order by prep.id asc]]>
- </query>
- <query name="RecipeAll">
- <![CDATA[from magoffin.matt.ieat.domain.Recipe recipe order by recipe.id asc]]>
- </query>
-
- <query name="RecipeAllCount">
- <![CDATA[select count(*) from magoffin.matt.ieat.domain.Recipe]]>
- </query>
-
- <query name="RecipeUsedAsIngredient">
- <![CDATA[
- select rr
- from magoffin.matt.ieat.domain.Recipe rr,
- magoffin.matt.ieat.domain.RecipeIngredient ri
- where ri in elements(rr.Ingredient)
- and ri.Recipe.id = ?
- order by lower(rr.Name)
- ]]>
- </query>
-
- <query name="SystemAll">
- <![CDATA[from magoffin.matt.ieat.domain.System sys order by lower(sys.Value) asc]]>
- </query>
- <query name="UserByEmail">
- <![CDATA[from magoffin.matt.ieat.domain.User user where lower(user.Email) = lower(?)]]>
- </query>
- <query name="UserByLogin">
- <![CDATA[from magoffin.matt.ieat.domain.User user where user.Login = ?]]>
- </query>
- <query name="UsersForAccessLevel">
- <![CDATA[from magoffin.matt.ieat.domain.User user where user.AccessLevel >= ?]]>
- </query>
- <query name="UnitsAll">
- <![CDATA[from magoffin.matt.ieat.domain.Unit units order by lower(units.Value) asc]]>
- </query>
-
- <query name="UnitsForSystem">
- <![CDATA[from magoffin.matt.ieat.domain.Unit units where units.SystemId = ? or units.SystemId is null order by lower(units.Value) asc]]>
- </query>
-
- <!-- SQL queries below -->
- <sql-query name="UsersStaleRegistration">
- <!-- FIXME: this query is hard-coded because I couldn't find a way for MySQL to allow the interval as a ? parameter -->
- <return alias="users" class="magoffin.matt.ieat.domain.User"/>
- <![CDATA[select {users.*} from users {users} where users.createdDate < date_sub(current_date,interval 14 day) and users.accessLevel < 0]]>
- </sql-query>
- </hibernate-mapping>
|