Commit 40339c49 authored by Eduardo Macarron's avatar Eduardo Macarron

Updated legal texts

parent cc0001db
Follow the next steps to run the sample on Tomcat 7.0
- Download and install a JDK
- Download and upzip Eclipse
- Download and unzip Tomcat 7
- Run Eclipse
- In eclipse, go to Help/Eclipse Marketplace
- Install m2e plugin (maven)
- Install m2e-wtp plugin (maven for wtp)
- Unzip mybatis-jpetstore-6.0.x-sources.zip
- In eclipse, select File/Import/Maven/Existing Maven Projects
- Select the folder where you unzipped mybatis-jpetstore-6.0.x-sources.zip
- A new project named "jpetstore" will be shown
- Right click on jpetstore project and select "run on server"
- Select Tomcat 7 Server and set your installation directory
- JPetStore home page should be shown
\ No newline at end of file
JPetStore 6 is a full web application built on top of MyBatis 3, Spring 3 and Stripes. It is available for downloading in the downloads section of MyBatis project site. In this section we will walk through this sample to understand how is it built and learn how to run it.
See: http://www.mybatis.org/spring/sample.html
Follow the next steps to run the sample on Tomcat 7.0
- Download and install a JDK, eclipse and tomcat 7
- Run Eclipse
- In eclipse, go to Help/Eclipse Marketplace
- Install m2e plugin (maven)
- Install m2e-wtp plugin (maven for wtp)
- Check out the project from Git and import it into the workspace
- A new project named "jpetstore-6" will be shown
- Right click on jpetstore project and click on configure/convert to maven project
- Right click on jpetstore project and select "run on server"
- Select Tomcat 7 Server and set your installation directory
- JPetStore home page should be shown
<?xml version="1.0"?>
<!--
Copyright 2010-2013 The MyBatis Team
Copyright 2010-2013 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
import net.sourceforge.stripes.validation.Validate;
/**
* @author Eduardo Macarron
*
*/
public class Account implements Serializable {
private static final long serialVersionUID = 8751282105532159742L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
......@@ -9,6 +25,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author Eduardo Macarron
*
*/
public class Cart implements Serializable {
private static final long serialVersionUID = 8329559983943337176L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author Eduardo Macarron
*
*/
public class CartItem implements Serializable {
private static final long serialVersionUID = 6620528781626504362L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
/**
* @author Eduardo Macarron
*
*/
public class Category implements Serializable {
private static final long serialVersionUID = 3992469837058393712L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author Eduardo Macarron
*
*/
public class Item implements Serializable {
private static final long serialVersionUID = -2159121673445254631L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author Eduardo Macarron
*
*/
public class LineItem implements Serializable {
private static final long serialVersionUID = 6804536240033522156L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
......@@ -7,6 +23,10 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
* @author Eduardo Macarron
*
*/
public class Order implements Serializable {
private static final long serialVersionUID = 6321792448424424931L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
/**
* @author Eduardo Macarron
*
*/
public class Product implements Serializable {
private static final long serialVersionUID = -7492639752670189553L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.domain;
import java.io.Serializable;
/**
* @author Eduardo Macarron
*
*/
public class Sequence implements Serializable {
private static final long serialVersionUID = 8278780133180137281L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import org.mybatis.jpetstore.domain.Account;
/**
* @author Eduardo Macarron
*
*/
public interface AccountMapper {
Account getAccountByUsername(String username);
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import java.util.List;
import org.mybatis.jpetstore.domain.Category;
/**
* @author Eduardo Macarron
*
*/
public interface CategoryMapper {
List<Category> getCategoryList();
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import java.util.List;
......@@ -5,6 +21,10 @@ import java.util.Map;
import org.mybatis.jpetstore.domain.Item;
/**
* @author Eduardo Macarron
*
*/
public interface ItemMapper {
void updateInventoryQuantity(Map<String, Object> param);
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import java.util.List;
import org.mybatis.jpetstore.domain.LineItem;
/**
* @author Eduardo Macarron
*
*/
public interface LineItemMapper {
List<LineItem> getLineItemsByOrderId(int orderId);
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import java.util.List;
import org.mybatis.jpetstore.domain.Order;
/**
* @author Eduardo Macarron
*
*/
public interface OrderMapper {
List<Order> getOrdersByUsername(String username);
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import java.util.List;
import org.mybatis.jpetstore.domain.Product;
/**
* @author Eduardo Macarron
*
*/
public interface ProductMapper {
List<Product> getProductListByCategory(String categoryId);
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.persistence;
import org.mybatis.jpetstore.domain.Sequence;
/**
* @author Eduardo Macarron
*
*/
public interface SequenceMapper {
Sequence getSequence(Sequence sequence);
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.service;
import org.mybatis.jpetstore.domain.Account;
......@@ -6,6 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author Eduardo Macarron
*
*/
@Service
public class AccountService {
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.service;
import java.util.List;
......@@ -11,6 +27,10 @@ import org.mybatis.jpetstore.persistence.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author Eduardo Macarron
*
*/
@Service
public class CatalogService {
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.service;
import java.util.HashMap;
......@@ -16,6 +32,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author Eduardo Macarron
*
*/
@Service
public class OrderService {
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.web.actions;
import java.io.Serializable;
......@@ -6,6 +22,10 @@ import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.SimpleMessage;
/**
* @author Eduardo Macarron
*
*/
abstract class AbstractActionBean implements ActionBean, Serializable {
private static final long serialVersionUID = -1767714708233127983L;
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.web.actions;
import java.util.ArrayList;
......@@ -19,6 +35,10 @@ import org.mybatis.jpetstore.domain.Product;
import org.mybatis.jpetstore.service.AccountService;
import org.mybatis.jpetstore.service.CatalogService;
/**
* @author Eduardo Macarron
*
*/
@SessionScope
public class AccountActionBean extends AbstractActionBean {
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mybatis.jpetstore.web.actions;
import java.util.Iterator;
......@@ -14,6 +30,10 @@ import org.mybatis.jpetstore.domain.CartItem;
import org.mybatis.jpetstore.domain.Item;
import org.mybatis.jpetstore.service.CatalogService;
/**
* @author Eduardo Macarron
*
*/
@SessionScope
public class CartActionBean extends AbstractActionBean {
......
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.