This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from hardingadonis/dev
Sale Dock - v0.0.2
- Loading branch information
Showing
30 changed files
with
771 additions
and
48 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
|
||
major_version=0 | ||
minor_version=0 | ||
path_version=1 | ||
path_version=2 | ||
|
||
echo "$major_version.$minor_version.$path_version" |
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
4 changes: 1 addition & 3 deletions
4
src/main/java/io/hardingadonis/saledock/controller/Controller.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,5 +1,3 @@ | ||
package io.hardingadonis.saledock.controller; | ||
|
||
public class Controller { | ||
|
||
} | ||
public class Controller {} |
6 changes: 6 additions & 0 deletions
6
src/main/java/io/hardingadonis/saledock/dao/ICategoryDAO.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import io.hardingadonis.saledock.model.*; | ||
|
||
public interface ICategoryDAO extends IDAO<Category> { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/io/hardingadonis/saledock/dao/ICustomerDAO.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import io.hardingadonis.saledock.model.*; | ||
|
||
public interface ICustomerDAO extends IDAO<Customer> { | ||
} |
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,14 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import java.util.*; | ||
|
||
public interface IDAO<T> { | ||
|
||
public void add(T obj); | ||
|
||
public Optional<T> getByID(Integer ID); | ||
|
||
public List<T> getAll(); | ||
|
||
void update(T obj); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/io/hardingadonis/saledock/dao/IEmployeeDAO.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import io.hardingadonis.saledock.model.*; | ||
|
||
public interface IEmployeeDAO extends IDAO<Employee> { | ||
} |
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,7 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import io.hardingadonis.saledock.model.*; | ||
|
||
public interface IOrderDAO extends IDAO<Order> { | ||
|
||
} |
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,6 @@ | ||
package io.hardingadonis.saledock.dao; | ||
|
||
import io.hardingadonis.saledock.model.*; | ||
|
||
public interface IProductDAO extends IDAO<Product> { | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/io/hardingadonis/saledock/dao/impl/CategoryDAOImpl.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.hardingadonis.saledock.dao.impl; | ||
|
||
import io.hardingadonis.saledock.dao.*; | ||
import io.hardingadonis.saledock.model.*; | ||
import io.hardingadonis.saledock.utils.*; | ||
import java.util.*; | ||
import org.hibernate.*; | ||
|
||
public class CategoryDAOImpl implements ICategoryDAO { | ||
|
||
private final SessionFactory sessionFactory; | ||
|
||
public CategoryDAOImpl() { | ||
this.sessionFactory = HibernateUtil.getSessionFactory(); | ||
} | ||
|
||
@Override | ||
public void add(Category obj) { | ||
try (Session session = sessionFactory.openSession()) { | ||
session.beginTransaction(); | ||
session.persist(obj); | ||
session.getTransaction().commit(); | ||
} | ||
} | ||
|
||
@Override | ||
public Optional<Category> getByID(Integer ID) { | ||
try (Session session = sessionFactory.openSession()) { | ||
return Optional.ofNullable(session.get(Category.class, ID)); | ||
} | ||
} | ||
|
||
@Override | ||
public List<Category> getAll() { | ||
try (Session session = sessionFactory.openSession()) { | ||
return session.createQuery("FROM Category", Category.class).getResultList(); | ||
} | ||
} | ||
|
||
@Override | ||
public void update(Category obj) { | ||
try (Session session = sessionFactory.openSession()) { | ||
session.beginTransaction(); | ||
session.merge(obj); | ||
session.getTransaction().commit(); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/io/hardingadonis/saledock/dao/impl/CustomerDAOImpl.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.hardingadonis.saledock.dao.impl; | ||
|
||
import io.hardingadonis.saledock.dao.*; | ||
import io.hardingadonis.saledock.model.*; | ||
import io.hardingadonis.saledock.utils.*; | ||
import java.util.*; | ||
import org.hibernate.*; | ||
|
||
public class CustomerDAOImpl implements ICustomerDAO { | ||
|
||
private final SessionFactory sessionFactory; | ||
|
||
public CustomerDAOImpl() { | ||
this.sessionFactory = HibernateUtil.getSessionFactory(); | ||
} | ||
|
||
@Override | ||
public void add(Customer obj) { | ||
try (Session session = sessionFactory.openSession()) { | ||
session.beginTransaction(); | ||
session.persist(obj); | ||
session.getTransaction().commit(); | ||
} | ||
} | ||
|
||
@Override | ||
public Optional<Customer> getByID(Integer ID) { | ||
try (Session session = sessionFactory.openSession()) { | ||
return Optional.ofNullable(session.get(Customer.class, ID)); | ||
} | ||
} | ||
|
||
@Override | ||
public List<Customer> getAll() { | ||
try (Session session = sessionFactory.openSession()) { | ||
return session.createQuery("FROM Customer", Customer.class).getResultList(); | ||
} | ||
} | ||
|
||
@Override | ||
public void update(Customer obj) { | ||
try (Session session = sessionFactory.openSession()) { | ||
session.beginTransaction(); | ||
session.merge(obj); | ||
session.getTransaction().commit(); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/io/hardingadonis/saledock/dao/impl/EmployeeDAOImpl.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.hardingadonis.saledock.dao.impl; | ||
|
||
import io.hardingadonis.saledock.dao.*; | ||
import io.hardingadonis.saledock.model.*; | ||
import io.hardingadonis.saledock.utils.*; | ||
import java.util.*; | ||
import org.hibernate.*; | ||
|
||
public class EmployeeDAOImpl implements IEmployeeDAO { | ||
|
||
private final SessionFactory sessionFactory; | ||
|
||
public EmployeeDAOImpl() { | ||
this.sessionFactory = HibernateUtil.getSessionFactory(); | ||
} | ||
|
||
@Override | ||
public void add(Employee obj) { | ||
try (Session session = sessionFactory.openSession()) { | ||
session.beginTransaction(); | ||
session.persist(obj); | ||
session.getTransaction().commit(); | ||
} | ||
} | ||
|
||
@Override | ||
public Optional<Employee> getByID(Integer ID) { | ||
try (Session session = sessionFactory.openSession()) { | ||
return Optional.ofNullable(session.get(Employee.class, ID)); | ||
} | ||
} | ||
|
||
@Override | ||
public List<Employee> getAll() { | ||
try (Session session = sessionFactory.openSession()) { | ||
return session.createQuery("FROM Employee", Employee.class).getResultList(); | ||
} | ||
} | ||
|
||
@Override | ||
public void update(Employee obj) { | ||
try (Session session = sessionFactory.openSession()) { | ||
session.beginTransaction(); | ||
session.merge(obj); | ||
session.getTransaction().commit(); | ||
} | ||
} | ||
} |
Oops, something went wrong.