Below is java code : TypedQuery outputSql = entityManager.createQuery(query); org.eclipse.persistence.sessions.Session session = communityEm.unwrap(org.eclipse.persistence.jpa.JpaEntityManager.class).getActiveSession(); org.eclipse.persistence.queries.DatabaseQuery databaseQuery = outputSql.unwrap(org.eclipse.persistence.jpa.JpaQuery.class).getDatabaseQuery(); databaseQuery.prepareCall(session, new org.eclipse.persistence.sessions.DatabaseRecord()); System.out.println(“databaseQuery.getSQLString()”+databaseQuery.getSQLString());
Read MoreIdea tool short cut on Mac
1. Optimize import java classes //use this short cut can remove redundant/unused classes Shift+Command + A , then Enter 2. Find java file Control + Shift + O 3. Find keyword in projects Control + Shift + F
Read MoreMaven/git issue fixed examples
1. When maven compile code, there are too much resource files downloading, how to avoid it every time mvn clean compile -o install 2. When met ‘Changes not staged for commit’ in ‘git commit’ for review issue Cases are 1) when pull from remote branch1 2) Modify and submit, then push to remote branch2 3) […]
Read MoreJAVA JPA Join relations for multiple tables
E.g. we have sql below select A.id, A.name, B.name2, C.name2 from A,B,C where A.id=B.bid and B.name3 = C.id We use join to connect JPA tables // Root rootpath Entity A,B,C in B has relasionship B.name3 = C Join b_path = rootpath.join(“id”); Join c_path = b_path.join(“name3”);
Read MoreJava code knowledge
1. Get client timezone Calendar.getInstance().getTimeZone() 2. JPA sql output //queryType:TypedQuery System.out.println(queryType.unwrap(org.eclipse.persistence.jpa.JpaQuery.class).getDatabaseQuery().getSQLString()); 3. LocalDateTime to Date //local_time : LocalDateTime Date.from( local_time.atZone( ZoneId.systemDefault()).toInstant()),
Read MoreHANA USAGE POINTS
1. client tool DBeaver 2. sql code structure — when you need to run more commands.e.g insert/update etc DO BEGIN DECLARE var1 number; DECLARE var2 number; –sql commands COMMIT; END; 3. connect sql CONNECT DBName PASSWORD dbpassword 4. dummy for sequence select example_seq_name from dummy
Read MoreExpressVPN for DevOps
Why use ExpressVPN for programming or devops when facing blocked 1) Stable & Fast connection When downloading docker images, we need stable and fast connection 2) Google necessary…. Find some good solutions for issues, have to 3) Nice support and trouble shooting responsibilities. Talk to nice supporter and they can keep updating info when issues, […]
Read MoreGit commands for development workflow
1. checkout remote dev branch to local git checkout -b local_dev_branch origin/dev 2. after modified, submit to local, the example shows submit modified java files. git commit -m *.java “modified java files” 3. after submit code in local, you can submit own branch to remote, the branch name can be same with local branch name […]
Read Morestart/stop jenkins service on mac
## start sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist ## stop sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Read More