Get or count(*) (row count) from hibernate criterion

public Integer getActiveAlertCount(Company company){ Alert alert = new Alert(); Integer count = 0; try { Session session = getSession(); Criteria c = session.createCriteria(MyClass.class,”myalias”); c.add(Restrictions.eq(“MyRestriction”, myrestrictionclass)); //****below is the important part**** count = c.setProjection(Projections.rowCount()).uniqueResult().hashCode(); }catch(Exception e){ e.printStackTrace(); } return count; }

Read More →

How to map a domain (or sub-domain) to AWS Elastic Beanstalk instance

These directions should be the same whether you are using Amazon’s route 53 DNS or any other provider. Login to you where ever you have your domains DNS managed In another browser window login and navigate to AWS Elastic Beanstalk service home page. In the green box of the application […]

Read More →

Top 10 Live Guitar Performances part 1

What makes a good live performance? An artist who feeds off the energy of the crowd (whatever that may be) and incorporates it into their performance through improvisation. Please enjoy my top 10 picks as of 2015. 10.) John Mayer – California Dreamin 9.) Eric Clapton (cream) – Crossroads 8.) Santana […]

Read More →

Using context path for local development with AngularJS and Java

Using the context path when developing is a common practice when developing applications locally that use URLs or access static files within the project. When I first started setting up my angularJS project with my existing spring MVC project, I needed to figure out how to have angularJS javascript files […]

Read More →

What folder is tomcat located in on AWS EC2 instance and how to restart tomcat?

Since 2012 tomcat is located at /usr/share/tomcat{version number}. So, for example, if you are using tomcat 8, it is located at /usr/share/tomcat8. Or if you’re unsure, just go type in /usr/shar/ and then t and hit the tab key. It will auto fill with the correct directory. If you still […]

Read More →

AssetEntryQuery By Category, Tag, Type, and Keyword example | Liferay 6.1, 6.2

Liferay 6.1 or 6.2 using AssetEntryQuery to search by Category, Tag, Type, and Keyword.  This example will allow you to query any asset type (web content, document, blog post, message board post, custom assets, etc..) by Category, Tag, Type, and Keyword.  Possible applications for this code would be using it […]

Read More →

Matcha Tea – Review: Spoiler alert, it’s awesome

I started drinking Matcha tea daily about a month ago after reading several articles touting it’s effect on Mental focus and it’s ridiculously high amount of antioxidants.  I can honestly say that I’ve been pretty impressed and so far the tea seems to live up to  it’s hype.  After a […]

Read More →

Why you’re losing money by not upgrading your cell phone

I’m willing to freely admit that I am gadget obsessed.  Out of all the tech gadgets I research or purchase none gets me more excited than smart phones.  With each new year comes better screen resolution, camera upgrades, thinner, flatter, faster, better.  I personally am an iphone user but this […]

Read More →

How to redirect http to https in (non-SSL to SSL) IIS 7

Steps: 1.) Open IIS and right click on the website you wish to redirect to https and select “edit bindings”. 2.) Change the port number to an unused port.  For example: 8888 3.) Go to the SSL settings of the site and select “require SSL” 4.) Create a brand new […]

Read More →

14 ways to increase local SEO (and traffic) instantly to your website

Here are the top 14 sites that allow you to create business listings that link back to your website.  These links are crucial in establishing credibility in the search engines eyes.  Every business should create listings on these 14 sites as their first step towards off page optimization. Create a facebook fan […]

Read More →