Posts

Showing posts from December, 2015

EGit Eclipse refresh branch list

Problem: Can't see all existing branches while in the repository view.

Solution: Select the git repository > right click > Pull > Ok

Hibernate - Update with Inner Join

Problem: Perform an hibernate update  based on the results from a inner join.

Solution:String hqlUpdate = "update Product p "
+ "set p.flowStatus = :toFlowStatus "
+ "where p.id in "
+ "(select fp.id "
+ "from OrderProduct as op "
+ "inner join op.product as p "
+ "where op.flowStatus = :orderProductFlowStatus"
+ ")";
sessionFactory.getCurrentSession().createQuery(hqlUpdate)
.setString( "toFlowStatus", toFlowStatus.getKey().toString())
.setString( "orderProductFlowStatus", feedProductDeltaFlowStatus.getKey().toString())
.executeUpdate();

Groovy, Soap UI - Mock service parameter testing script example

import java.net.*

// Match based on query parameter
def queryString = mockRequest.getRequest()getQueryString();
def paramMap = queryString.split('&').collectEntries { param ->
    param.split('=').collect { URLDecoder.decode(it) }
}
//def paramCount = paramMap.size()

if( queryString == null)
{
     log.info "400 bad request - no parameters";      
        return "400 bad request - no parameters";
}
else if( queryString.contains(" "))
{
     log.info "400 bad request - queryString not correctly encoded";
        return "400 bad request - queryString not correctly encoded";
}
else if( paramMap.size() > 1)
{
     log.info "400 bad request - too many parameters";      
        return "400 bad request - too many parameters";
}
else if( paramMap['q'] == null)
{
    log.info "400 bad request - wrong variable name";
    return "400 bad request - wrong variable name";
}
else if( paramMap['q&…

Play - play.libs.ws.WSClient [error] cannot find symbol

Problem:[error] (...): package play.libs.ws does not exist
[error] play.libs.ws.WSClient
[error] (...): cannot find symbol
[error]   symbol:   class WSClient
[error]   location: class controllers.(...)
[error] WSClient
[error] (compile:compileIncremental) javac returned nonzero exit code


Solution: Add  javaWs to build.sbt file:

libraryDependencies ++= Seq(
javaWs
 )


and refresh the project:
sbt clean compile run or,activator clean compile run

Play - IllegalStateException: path.home is not configured

Problem: IllegalStateException: path.home is not configured
Solution:  Passing an activator initialization parameter (-Des.path.home): ./activator -DenvTarget=local -Des.path.home=/Project/Path/etc -jvm-debug  9010 clean compile run