Mark Spritzler

+ Follow
since Feb 05, 2001
Mark likes ...
Mac IntelliJ IDE Spring
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Spritzler

I really miss seeing Kathy and Bert. You guys are always awesome.
1 year ago
Very interesting study. Without actual numbers I do find on my MacBook that when I run Eclipse, my machine is a mess. It runs really really slow. I have to quit Eclipse and then everything goes back to normal. I never have to do that with IntelliJ running the same servers and code etc.

5 years ago
I know this has been solved for the OP. But there is another possible solution, not in the query, but in terms of removing an unknown number of leading "0" and returning what is left, and then being able to use it in JPA queries after. It is posted in the SO post linked at the top, so I can't take credit for it, but that one did have one slight error though in that the result of the formula is a String not an Integer.

@Formula("TRIM(LEADING '0' FROM account_number)")
private String trimmedAccountNumber;


Ever since i upgraded a couple weeks ago, my machine has gotten to a crawl. The solution to speed it back up is to disconnect my second monitor and then reconnect it. It isn't exactly IntelliJ's fault, but it is Java/IntelliJ that is causing the issue of IntelliJ taking up too much CPU % over 300% when there is a second monitor connected.

Some solutions says you just have to upgrade your Nvidia Graphics driver, but I have done that and it did not help me.

I am also on a 2013 15" MacBook Pro with 16GB ram and I heard 2016 and higher might not have this issue.

But be careful

Mark S.
6 years ago
I know this is a long time since posted but

row.createCell() creates a new cell in a row.

7 years ago
By the way Norman is one of the coolest person's in the whole world! And he gets to work at Apple.

But the big question is, are you going to be moved the big space ship office space when it is finished?

Welcome Norman.

I recommend making the server side speak to the client with JSON, not XML. So either a REST API using something like Spring REST MVC. Another option, but something new to learn is something like Vert.x which allows for http, sockets and web sockets to connect to a server. but still sending JSON back and forth.

8 years ago
No. You should only create one SessionFactory/EntitnyManagerFactory for your entire application. And you "registerEmployeeBean" Is not of type LocalSessionFactoryBean.

In A Spring Application you use a layered approach. Service layer for your business use case code and transaction demarcation at methods level. Repository Layer that stores your queries to run. And then there is the SessionFactory underneath. The sessionFactory gets injected into your repository classes. So one bean for sessionFactory and one bean per repository class with dependency injection injecting the sessionFactory into the repository classes. Then the repository classes are injected into the Service layer classes.

relational mapping??? No idea what you mean by that as a separate thing. In Hibernate you are mapping to your relational database, so technically all the mapping in Hibernate is relational mapping. And you can't use hibernate without any mapping.

Now Inheritance mapping is different, and it is used for specific reasons. Personally, I actually avoid using Inheritance as much as possible. HOWEVER, there are times where a hierarchical Domain object model is warranted. If you have domain objects that inherit from other domain objects, then you sort of have to use inheritance mapping. Just to make it cleaner. It still isn't required.

Basically, it is about your domain classes. And in Java, I think it is always better to try not to use inheritance in your domain code, but sometimes it is necessary. I still find it rare when I need to use it. My friend on my team though, loves ORM inheritance mapping. ;)

What I find with inheritance mapping is that later when you want to delete data in via ORM code, it becomes a bit tougher to delete it because the data model becomes coupled/intertwined and more difficult to find the right order of deletion of rows through a bunch of db tables.

I am a huge proponent of Hibernate and JPA in general. But based on your description of what you are doing, I actually recommend using something like Spring Batch with Spring JdbcTemplate class to do the work.

If anything use JDBC and Spring's JdbcTemplate. You do not need to include all of Spring and an ApplicationContext if you just use the template and not Spring Batch. It is a simple class that only needs a reference to your DataSource object. But in the end it will save you from all the JDBC boilerplate code.

Friends don't let friends write straight JDBC code.

Not enough information to say yes or no. But if that is the exception you see, then that is what is being thrown.

I am going to move this to the JSF forum. This forum is for ORM questions, and your issue isn't about ORM.

Good Luck

8 years ago
Um, what is the actual value of bookType? You can either put a break point in there to see the value when it gets there, or a log message, or even a println "${bookType}"

Maybe there isn't an "ALL" value, maybe it is "All" or "all" where it is a different case. The only time an else will run is if the "if" is truly false. I like that truly false. Or just false.

8 years ago
John's solution is the most elegant and easiest. But to demonstrate what you did wrong. Here is where we assign the var outside the loop and the results. Run this code in a Groovy Console and look at the results.

Basically, I took out the query from the equation as you will see why stuff isn't getting into the Map. Then after you fix your code, put a break point or printout the values in your map so you can see the values inside there, then if it doesn't show up in your table then it is the table/view that is wrong.

8 years ago

Guillermo Ishi wrote:

Mark Spritzler wrote:

Yes 100% it has to be unbreakable

The other criteria was to try and make the server side not have to keep track of time for this,

(But there still will always be the timer) and that is the puzzle of this thread.


I think if you are relying on a timer other than one on your server the prizes should not be very valuable! I think the security should be in the timer on your server. I would suggest maybe everybody could be on the same timer and so you might have to be logged in as long as 59 min. before you become eligible (in the next hour). You could display "next giveaway begins in..." A local timer is too easy to defeat, just by switching computers for example.

You mean if I click on something that says free gift I might really get something besides a virus?

There isn't an actual "timer" on the server side that counts down. It is time since last free chips that the player received. It is a very common thing on casino type games with chips. For instance. My Vegas ios App is one then you have to wait at least 3 hours to get your next one. But you don't have to be logged in/in the game.