Category Archives: Без рубрики

Java.Hibernate.Middle.How do you handle database-specific features (e.g., JSON columns) in Hibernate?

✅ Short Answer In Hibernate, you handle database-specific features (like JSON columns) by:✅ Using custom types (e.g., UserType, AttributeConverter) to map complex or non-standard DB types to Java types.✅ Leveraging Hibernate dialects that support native functions or types.✅ (In newer … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Middle.How do you handle database-specific features (e.g., JSON columns) in Hibernate?

Java.Hibernate.Middle.What is optimistic vs. pessimistic locking, and how do you implement them?

✅ Short Answer Optimistic locking assumes conflicts are rare → it lets multiple transactions read data simultaneously and checks for conflicts only at commit time (using a @Version field). Pessimistic locking assumes conflicts are likely → it locks the data … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Middle.What is optimistic vs. pessimistic locking, and how do you implement them?

Java.Hibernate.Middle.In which case hibernate will not add where clause on delete ?

✅ Short Answer Both HQL and JPQL are basically the same thing (JPQL is the standard; HQL is Hibernate’s dialect).Hibernate will add the @Where clause automatically if you query the entity directly — whether you use: FROM User u (HQL … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Middle.In which case hibernate will not add where clause on delete ?

Java.Hibernate.Explain what means use JPQL without deleted=false ?

✅ Short Answer When you write a JPQL or native SQL query without explicitly including deleted = false, you risk retrieving soft-deleted rows, because without a @Where filter, your query doesn’t exclude them by default. 🔎 Detailed Explanation 🔹 What … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Explain what means use JPQL without deleted=false ?

Java.Hibernate.Medium.How do you implement soft deletes in Hibernate?

✅ Short Answer In Hibernate, you implement soft deletes by adding a field (e.g., deleted, active) to your entity and using either:✅ A query filter (@SQLDelete + @Where), or✅ Manual query conditions,so the entity is marked as deleted instead of … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Medium.How do you implement soft deletes in Hibernate?

Java.Hibernate.Medium.Explain how MultiTenantConnectionProvider works and CurrentTenantIdentifierResolver works ?

✅ Short Answer MultiTenantConnectionProvider is the Hibernate SPI that provides connections specific to each tenant, e.g., different schemas or databases. CurrentTenantIdentifierResolver tells Hibernate which tenant ID to use for the current request. Together, they let Hibernate dynamically route connections and … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Medium.Explain how MultiTenantConnectionProvider works and CurrentTenantIdentifierResolver works ?

Java.Hibernate.Medium.What is multi tenant apps ?

✅ Short Answer A multi-tenant application is a single application instance that serves multiple customers (tenants), while keeping each tenant’s data isolated.It allows you to share the same codebase and infrastructure while giving every tenant the feeling of their own … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Medium.What is multi tenant apps ?

Java.Hibernate.Middle.How do you change the default schema used by Hibernate?

✅ Short Answer You can change the default schema Hibernate uses by setting the hibernate.default_schema property in your configuration → it tells Hibernate to apply this schema to unqualified table names. 🔎 Detailed Explanation 🔹 Global default schemaYou can set … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Middle.How do you change the default schema used by Hibernate?

Java.Hibernate.Middle.What’s the purpose of the hibernate.hbm2ddl.auto property?

✅ Short Answer The hibernate.hbm2ddl.auto property controls automatic schema generation and management by Hibernate.It tells Hibernate whether it should create, update, validate, or do nothing with your database schema when your application starts. 🔎 Detailed Explanation 🔹 Common values:✅ noneHibernate … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Middle.What’s the purpose of the hibernate.hbm2ddl.auto property?

Java.Hibernate.Middle.What’s the purpose of the hibernate.show_sql property?

✅ Short Answer The hibernate.show_sql property tells Hibernate to log all SQL statements it generates directly to the console (standard output).It’s a helpful debugging tool to see the actual SQL queries Hibernate sends to the database. 🔎 Detailed Explanation 🔹 … Continue reading →

Posted in Без рубрики | Comments Off on Java.Hibernate.Middle.What’s the purpose of the hibernate.show_sql property?