-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing database structure to be hibernate friendly :(
- Loading branch information
1 parent
251ed16
commit 65b5066
Showing
14 changed files
with
77 additions
and
84 deletions.
There are no files selected for viewing
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
28 changes: 8 additions & 20 deletions
28
src/main/java/net/feminaexlux/gallery/struts2/controller/Gallery.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 |
---|---|---|
@@ -1,46 +1,34 @@ | ||
package net.feminaexlux.gallery.struts2.controller; | ||
|
||
import net.feminaexlux.gallery.struts2.model.Album; | ||
import net.feminaexlux.gallery.struts2.model.Resource; | ||
import net.feminaexlux.gallery.struts2.service.AlbumService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
public class Gallery extends Controller { | ||
public static final int ALBUM_ID = 2; | ||
import java.util.List; | ||
|
||
public class Gallery extends Controller { | ||
@Autowired | ||
private AlbumService albumService; | ||
|
||
private Album album; | ||
private List<Album> albums; | ||
|
||
@Override | ||
public String execute() throws Exception { | ||
album = albumService.getAlbum(ALBUM_ID); | ||
albums = albumService.getAll(); | ||
|
||
return SUCCESS; | ||
} | ||
|
||
public String save() { | ||
album = albumService.getAlbum(ALBUM_ID); | ||
album.setDescription("Test"); | ||
album.setName("Test"); | ||
|
||
albumService.save(album); | ||
|
||
return SUCCESS; | ||
} | ||
|
||
public String revert() { | ||
album = albumService.getAlbum(ALBUM_ID); | ||
album.setDescription("Original Art"); | ||
album.setName("Originals"); | ||
|
||
albumService.save(album); | ||
|
||
return SUCCESS; | ||
public Album getAlbum() { | ||
return album; | ||
} | ||
|
||
public Resource getAlbum() { | ||
return album; | ||
public List<Album> getAlbums() { | ||
return albums; | ||
} | ||
} |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> | ||
<%@ taglib prefix="s" uri="/struts-tags" %> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Gallery</title> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |