Compare commits

..

No commits in common. "a4e70a0739ff58f625f44ca6fae291af189f081e" and "f7ab0b1c572704b1714ba59a1a33db427a77e907" have entirely different histories.

7 changed files with 22 additions and 34 deletions

View File

@ -7,7 +7,7 @@
<groupId>com.mousetech.gourmet</groupId>
<artifactId>gourmetj</artifactId>
<version>0.2.5</version>
<version>0.2.2</version>
<packaging>jar</packaging>
<name>GourmetJ</name>

View File

@ -20,7 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.primefaces.event.FileUploadEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.orm.jpa.JpaSystemException;
import com.mousetech.gourmetj.persistence.model.Category;
import com.mousetech.gourmetj.persistence.model.Ingredient;
@ -649,18 +649,9 @@ public class RecipeDetailBean implements Serializable {
String ingkey = ing.getIngkey();
if (!StringUtils.isEmpty(ingkey)) {
try {
Shopcat scat = this.recipeService
.findShopcatForIngredientKey(ingkey);
ing.setShopCat(scat);
} catch (JpaSystemException ex) {
String msg = String.format(
"Database Error: Unable to fetch info on \"%s\".",
ingkey);
log.error(msg);
JSFUtils.addErrorMessage(msg);
}
}
// get ing list size, set ing position, append
List<IngredientUI> ingredients = getWrappedIngredients();

View File

@ -20,6 +20,9 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
import jakarta.servlet.DispatcherType;
@Configuration
@EnableWebSecurity

View File

@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.mousetech.gourmetj.persistence.model.Category;
import com.mousetech.gourmetj.persistence.model.Recipe;
/**
@ -23,7 +24,7 @@ import com.mousetech.gourmetj.persistence.model.Recipe;
public interface RecipeRepository
extends JpaRepository<Recipe, Long> {
List<Recipe> findByTitleContainingIgnoreCase(String searchText);
List<Recipe> findByTitleContaining(String searchText);
@EntityGraph(value="Recipe.findWorkingSet")
public Recipe findDetailsById(Long recipeId);
@ -31,11 +32,11 @@ public interface RecipeRepository
@Query(name = "Recipe.findCusines", nativeQuery = true)
List<String> FindCuisinesNative();
List<Recipe> findByCategories_CategoryContainsIgnoreCase(String searchText);
List<Recipe> findByCategories_CategoryContains(String searchText);
List<Recipe> findByCuisineContainsIgnoreCase(String searchText);
List<Recipe> findByCuisineContains(String searchText);
List<Recipe> findDistinctByIngredientHash_ItemContainsIgnoreCase(
List<Recipe> findDistinctByIngredientHash_ItemContains(
String searchText);
}

View File

@ -50,7 +50,7 @@ public class RecipeService implements Serializable {
public List<Recipe> findByTitle(String searchText) {
return recipeRepository
.findByTitleContainingIgnoreCase(searchText);
.findByTitleContaining(searchText);
}
public Recipe findByPrimaryKey(Long recipeId) {
@ -120,19 +120,14 @@ public class RecipeService implements Serializable {
}
public List<Recipe> findByCategoryLike(String searchText) {
return recipeRepository
.findByCategories_CategoryContainsIgnoreCase(
searchText);
return recipeRepository.findByCategories_CategoryContains(searchText);
}
public List<Recipe> findByCuisineLike(String searchText) {
return recipeRepository
.findByCuisineContainsIgnoreCase(searchText);
return recipeRepository.findByCuisineContains(searchText);
}
public List<Recipe> findByIngredientLike(String searchText) {
return recipeRepository
.findDistinctByIngredientHash_ItemContainsIgnoreCase(
searchText);
return recipeRepository.findDistinctByIngredientHash_ItemContains(searchText);
}
}

View File

@ -62,9 +62,9 @@
<p:outputLabel for="@next"
value="Title"
/>
<p:focus/>
<p:inputText id="rtitle"
size="45" required="true"
focus="true"
placeholder="A recipe title is required."
value="#{recipeDetailBean.recipe.title}"
>
@ -362,8 +362,8 @@
id="ctlAddIng"
value="+ Add"
onclick="ingButton(); return false;"
update=":growl"
/>
>
</p:commandButton>
</h:panelGroup>
</p:panel>
</p:tab>
@ -372,7 +372,6 @@
>
<p:panel header="Instructions">
<div id="insection">
<p:focus/>
<h:inputTextarea
id="ctlInstructions"
rows="30" cols="120"
@ -384,7 +383,6 @@
</p:tab>
<p:tab id="notesTab" title="Notes">
<p:panel header="Notes">
<p:focus/>
<h:inputTextarea id="ctlNotes"
rows="30" cols="120"
escape="false"