Running Liquibase xml file from command line

I’ve tested the code against Oracle database at work. First download the jar and issue the command similar to below, make sure you are in the xml file’s location [code] java -jar C:\Users\A243229\Desktop\liquibase.jar –driver=oracle.jdbc.OracleDriver –classpath=C:\JavaDev\mavenRepository\oracle\ojdbc14\10.2.0.3.0\ojdbc14-10.2.0.3.0.jar –changeLogFile=changelog-1.0.0.xml –url=jdbc:oracle:thin:@localhost:1521:xe –username=RBAC_TEST –password=rbactest1 update [/code] ref: http://www.liquibase.org/documentation/command_line.html

HSQL In-memory database hibernate maven config example

maven dependency <properties> <!– PROJECT DEPENDENCIES BEGIN –> <hsqldb.version>2.3.4</hsqldb.version> <!– PROJECT DEPENDENCIES END –> </properties> <dependencies> <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>${hsqldb.version}</version> </dependency> </dependencies> hibernate configuration <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.archive.autodetection">class,hbm</property> <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.connection.password">1</property> <property name="hibernate.connection.url">jdbc:hsqldb:mem:testdb</property> <property name="hibernate.hbm2ddl.auto">create</property> <mapping class="de.gameduell.entity.User"

JSF a closable div

In this sample I’ve achieved one of demanded tasks at work regarding a closable mobile app pane, when the site is visited on mobile devices This is a good example also to study how to pass and set values in the backbean. Because we know what JSF is more of action based although there are

Converting in between Blob and StringBuilder

From StringBuilder to Blob @Autowired private SessionFactory sessionFactory; //saving the blob field java.sql.Blob blob = org.hibernate.Hibernate.getLobCreator(sessionFactory.getCurrentSession()).createBlob(errorDescs.toString().getBytes()); From Blob to StringBuilder StringBuilder errorDescs = new StringBuilder(); //error description if (order.getBatchErrorDescription() == null){ errorDescs.append(response.getErrors().getDescription().toString() + ";"); } else{ try { Blob blob = order.getBatchErrorDescription(); byte[] byteData = blob.getBytes(1, (int) blob.length()); String data = new String(byteData); errorDescs.append(data) .append(response.getErrors().getDescription().toString()

Displaying messagebox from backing bean

This piece of code snippet will initially hide the primefaces dialog box, then in any action from the backing bean, it will be activated and seen Back bean RequestContext context = RequestContext.getCurrentInstance(); context.execute("PF('dlgBlackListVar').show();"); View <p:dialog id="dlgBlackList" widgetVar="dlgBlackListVar" header="#{msg.member_blacklist_header}" showEffect="clip" modal="true" visible="false"> <h:outputText value="#{msg.member_blacklist_content}" /> </p:dialog>

Primefaces navigating in between min and max dates

Today at work I was stuck at demonstrating all the possible years which are given by min and max date ranges in the backing bean in primefaces and jsf combo. So as default primefaces calendar component only displays just set the year range to maximize the value the way you wish <p:calendar id="birthdate" value="#{memberController.order.birthdate}" yearRange="c-70:c+10"