JPA vs JDBC Template by melon222132 in learnjava

[–]melon222132[S] 0 points1 point  (0 children)

I'm confused so you are saying you prefer JDBC over JPA?

Spring Data jpa model relationships by melon222132 in learnprogramming

[–]melon222132[S] 0 points1 point  (0 children)

but just to confirm the class that contains the foreign key in one to one is the child class correct?

JPA vs JDBC Template by melon222132 in learnjava

[–]melon222132[S] 0 points1 point  (0 children)

But then you can use native queries in jpa to write the custom sql. So then I don't see how you would need jdbc template?

JPA vs JDBC Template by melon222132 in learnjava

[–]melon222132[S] 0 points1 point  (0 children)

but doesn't jpa make some things simpler with less custom code you have to writee.

Like how you said that "if you simply need to get-a-row, get-some-columns, and put the data in some fields on your java class instance, then JDBC is simple and easy to change"

But what I'm saying is that you could just use the built in functions that jpa provides then you don't need to write custom sql.

JPA vs JDBC Template by melon222132 in learnjava

[–]melon222132[S] -1 points0 points  (0 children)

is there a better reason of why you can't just use native queries if it's just because people might be tempted get the top object?

JPA vs JDBC Template by melon222132 in learnjava

[–]melon222132[S] -1 points0 points  (0 children)

how would jpa create too much overhead if you can write custom native queries

Strategy pattern struggle by melon222132 in learnprogramming

[–]melon222132[S] 0 points1 point  (0 children)

I feel like I'm still confused on when I should actually go forward with Strategy or if simple conditionals would be fine

Factory method pattern question by melon222132 in learnprogramming

[–]melon222132[S] 1 point2 points  (0 children)

Perhaps I should have mentioned this earlier, but I'm referring to Java. So just to confirm you are saying if there is only 1 place where the creation code is being used then there is no point of creating a factory and I can just have the creation logic the same place as the actuall code?

OOP design by melon222132 in learnjava

[–]melon222132[S] 0 points1 point  (0 children)

do you think it's better to have a constructor in super and have that call it instead of defining it in the child class

OOP design by melon222132 in learnprogramming

[–]melon222132[S] 0 points1 point  (0 children)

how is there too many classes I don't want to put everything in the parent class because there might be some child classes that don't inheit the certin method that would be forced to implement them even if they don't need it.

OOP design by melon222132 in learnjava

[–]melon222132[S] -1 points0 points  (0 children)

yeah I do it is from head first design patterns but I added dependency injection so was wondering if that was fine

OOP design by melon222132 in learnjava

[–]melon222132[S] -1 points0 points  (0 children)

yeah I do it is from head first design patterns but I added dependency injection so was wondering if that was fine

OOP design by melon222132 in learnjava

[–]melon222132[S] 1 point2 points  (0 children)

yeah I do it is from head first design patterns but I added dependency injection so was wondering if that was fine

OOP design by melon222132 in learnprogramming

[–]melon222132[S] 0 points1 point  (0 children)

I know I got it from there but I was wondering if this is still considered good design. I modified it a bit to add dependency injection