DevNexus 2014
Out-of-the-box, Hibernate ORM offers limited overhead and decent throughput. Early-stage applications enjoy the convenience of ORM/JPA with great performance. However, scaling your application into an enterprise-level system introduces more demanding needs.
This talk will describe numerous tips and techniques to both increase Hibernate ORM performance, as well as decrease overhead. These include some basic tricks, such as mapping and fetching strategies. Entity enhancement instrumentation, third-party second level caching, Hibernate Search, and more complex considerations will also be discussed. The talk will include live demonstrations techniques and their before-and-after results.
General Waf detection and bypassing techniques. Main focus to demonstrate that how to take right approach to analyse the behaviour of web application firewall and then create test cases to bypass the same.
Rest-assured is a 100% java-based, BDD style, test library that you can use for testing REST api's in java projects. These are the slides from the presentation and demo I give at the 2017 #JBCNConf Java conference in Barcelona.
General Waf detection and bypassing techniques. Main focus to demonstrate that how to take right approach to analyse the behaviour of web application firewall and then create test cases to bypass the same.
Rest-assured is a 100% java-based, BDD style, test library that you can use for testing REST api's in java projects. These are the slides from the presentation and demo I give at the 2017 #JBCNConf Java conference in Barcelona.
EFK Stack이란 ElasticSearch, Fluentd, Kibana라는 오픈소스의 조합으로, 방대한 양의 데이터를 신속하고 실시간으로 수집/저장/분석/시각화 할 수 있는 솔루션입니다. 특히 컨테이너 환경에서 로그 수집을 위해 주로 사용되는 기술 스택입니다.
Elasitc Stack에 대한 소개와 EFK Stack 설치 방법에 대해 설명합니다.
Overview of Spring Boot for the rapid development of Java Applications and Microservices. More information can be found at : https://www.spiraltrain.nl/course-spring-boot-development/?lang=en
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...Amazon Web Services Korea
서비스 런칭을 위해 라이온하트와 카카오게임즈가 어떻게 최적 성능의 인스턴스를 선택하고, Windows 운영 체제를 최적화하며, 왜 Amazon Aurora를 기본 데이터베이스로 채택하였는지를 설명합니다. 또한, 출시부터 운영까지의 과정에서 MMORPG가 어떻게 AWS 상에서 설계되고, 게임 서버 성능을 극대할 수 있었는지에 대해 전달해드립니다.
JDK.IO 2016 (http://jdk.io)
Java EE 7 introduced a new batch processing API. This session will go over how to use the batch processing API introduced with Java EE 7. This API is makes it easy to implement long running data/compute intensive jobs which need to be scheduled or initiated on-demand. Basics of the API will be demonstrated via code samples. The API will also be compared to Spring Batching and Hadoop to provide context and guidance on when these technologies are appropriate.
This PDF describe how F5 ASM can detect and mitigate Application DDoS as well as Fine Tuning the DDoS profile thresholds. this file is public.
f5 ddos best practices
f5 ddos protection recommended practices
f5 ddos protection recommended practices
Pentesting Rest API's by :- Gaurang BhatnagarOWASP Delhi
Brief overview of API
▸ Fingerprinting & Discovering API
▸ Authentication attacks on API (JWT)
▸ Authorization attacks on API (OAuth)
▸ Bruteforce attacks on API
▸ Attacking Dev/Staging API
▸ Traditional attacks
A story of the passive aggressive sysadmin of AEMFrans Rosén
# By Frans Rosén
Adobe Experience Manager is an enterprise CMS with a troubled history. It was created with the angle of high customization factor, enabling consulting firms to deploy it all over the world for huge customers.
Then came security.
Frans will go through some terrible default configuration mistakes, Adobe’s love for bad Flash and how a sysadmin accidentialy exposed an international multi billion dollar company using only sad thoughts.
# About speaker
Frans Rosén is a tech entrepreneur, bug bounty hunter and a Security Advisor at Detectify, a security service for developers. He’s a frequent blogger at Detectify Labs and a top ranked participant of bug bounty programs, receiving some of the highest bounty payouts ever on HackerOne.
Frans was recently featured as #2 on Hackread’s list of 10 Famous Bug Bounty Hunters of All Time and the results of his security research has been covered in numerous international publications such as Observer, BBC, Ars Technica, Wired and Mashable.
CNIT 129S: Securing Web Applications Ch 1-2Sam Bowne
Slides for a college course based on "The Web Application Hacker's Handbook", 2nd Ed.
Ch 1: Web Application (In)security
Ch 2: Core Defense Mechanisms
Teacher: Sam Bowne
Website: https://samsclass.info/129S/129S_F16.shtml
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesBrett Meyer
DevNexus 2014
Hibernate has always revolved around data, ORM, and JPA. However, it’s much more than that. Hibernate has grown into a family of projects and capabilities, extending well beyond the traditional ORM/JPA space.
This talk will present powerful features provided both by Hibernate ORM, as well as third-party extensions. Some capabilities are brand new, while others are older-but-improved. Topics include multiple-tenancy, geographic data, auditing/versioning, sharding, OSGi, and integration with additional Hibernate projects. The talk will include live demonstrations.
EFK Stack이란 ElasticSearch, Fluentd, Kibana라는 오픈소스의 조합으로, 방대한 양의 데이터를 신속하고 실시간으로 수집/저장/분석/시각화 할 수 있는 솔루션입니다. 특히 컨테이너 환경에서 로그 수집을 위해 주로 사용되는 기술 스택입니다.
Elasitc Stack에 대한 소개와 EFK Stack 설치 방법에 대해 설명합니다.
Overview of Spring Boot for the rapid development of Java Applications and Microservices. More information can be found at : https://www.spiraltrain.nl/course-spring-boot-development/?lang=en
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...Amazon Web Services Korea
서비스 런칭을 위해 라이온하트와 카카오게임즈가 어떻게 최적 성능의 인스턴스를 선택하고, Windows 운영 체제를 최적화하며, 왜 Amazon Aurora를 기본 데이터베이스로 채택하였는지를 설명합니다. 또한, 출시부터 운영까지의 과정에서 MMORPG가 어떻게 AWS 상에서 설계되고, 게임 서버 성능을 극대할 수 있었는지에 대해 전달해드립니다.
JDK.IO 2016 (http://jdk.io)
Java EE 7 introduced a new batch processing API. This session will go over how to use the batch processing API introduced with Java EE 7. This API is makes it easy to implement long running data/compute intensive jobs which need to be scheduled or initiated on-demand. Basics of the API will be demonstrated via code samples. The API will also be compared to Spring Batching and Hadoop to provide context and guidance on when these technologies are appropriate.
This PDF describe how F5 ASM can detect and mitigate Application DDoS as well as Fine Tuning the DDoS profile thresholds. this file is public.
f5 ddos best practices
f5 ddos protection recommended practices
f5 ddos protection recommended practices
Pentesting Rest API's by :- Gaurang BhatnagarOWASP Delhi
Brief overview of API
▸ Fingerprinting & Discovering API
▸ Authentication attacks on API (JWT)
▸ Authorization attacks on API (OAuth)
▸ Bruteforce attacks on API
▸ Attacking Dev/Staging API
▸ Traditional attacks
A story of the passive aggressive sysadmin of AEMFrans Rosén
# By Frans Rosén
Adobe Experience Manager is an enterprise CMS with a troubled history. It was created with the angle of high customization factor, enabling consulting firms to deploy it all over the world for huge customers.
Then came security.
Frans will go through some terrible default configuration mistakes, Adobe’s love for bad Flash and how a sysadmin accidentialy exposed an international multi billion dollar company using only sad thoughts.
# About speaker
Frans Rosén is a tech entrepreneur, bug bounty hunter and a Security Advisor at Detectify, a security service for developers. He’s a frequent blogger at Detectify Labs and a top ranked participant of bug bounty programs, receiving some of the highest bounty payouts ever on HackerOne.
Frans was recently featured as #2 on Hackread’s list of 10 Famous Bug Bounty Hunters of All Time and the results of his security research has been covered in numerous international publications such as Observer, BBC, Ars Technica, Wired and Mashable.
CNIT 129S: Securing Web Applications Ch 1-2Sam Bowne
Slides for a college course based on "The Web Application Hacker's Handbook", 2nd Ed.
Ch 1: Web Application (In)security
Ch 2: Core Defense Mechanisms
Teacher: Sam Bowne
Website: https://samsclass.info/129S/129S_F16.shtml
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesBrett Meyer
DevNexus 2014
Hibernate has always revolved around data, ORM, and JPA. However, it’s much more than that. Hibernate has grown into a family of projects and capabilities, extending well beyond the traditional ORM/JPA space.
This talk will present powerful features provided both by Hibernate ORM, as well as third-party extensions. Some capabilities are brand new, while others are older-but-improved. Topics include multiple-tenancy, geographic data, auditing/versioning, sharding, OSGi, and integration with additional Hibernate projects. The talk will include live demonstrations.
How to Write the Fastest JSON Parser/Writer in the WorldMilo Yip
How RapidJSON is developed in order to achieve highest performance among 20 C/C++ JSON libraries. Benchmarks, some C++ design, algorithm and low-level optimizations are covered.
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
Memory leaks are not always simple or easy to find. Heap dumps from production systems are often gigantic (4+ gigs) with millions of objects in memory. Simple spot checking with traditional tools is woefully inadequate in these situations, especially with real data. Leaks can be entire object graphs with enormous amounts of noise. This session will show you how to build custom tools using the Apache NetBeans Profiler/Heapwalker APIs. Using these APIs, you can read and analyze Java heaps programmatically to ask really hard questions. This gives you the power to analyze complex object graphs with tens of thousands of objects in seconds.
Alfresco Business Reporting - Tech Talk Live 20130501Tjarda Peelen
This is the Slide Deck used in Alfresco's Tech Talk Live, May 1, 2013. It featured my Alfresco add-on: Alfresco Business Reporting. The purpose is to the technical 'why' and 'how' of the add-on module, the challenge faced and he solutions designed.
At Tuenti, we do two code pushes per week, sometimes modifying thousands of files and running thousands of automated tests and build operations before, to ensure not only that the code works but also that proper localization is applied, bundles are generated and files get deployed to hundreds of servers as fast and reliable as possible.
We use opensource tools like Mercurial, MySQL, Jenkins, Selenium, PHPUnit and Rsync among our own in-house ones, and have different development, testing, staging and production environments.
We had to fight with problems like statics bundling and versioning, syntax errors and of course the fact that we have +100 engineers working on the codebase, sometimes merging and releasing more than a dozen branches the same day. We also switched from Subversion to Mercurial to obtain more flexibility and faster branching operations.
With this talk we will explain the process of how code changes in ourcode repository end up in live code, detailing some practices and tips that we apply.
Some old and new tips, tricks and tools for rapid web application security assessment (black and white box). They are useful in various situtations: pentest with very limited time or huge scope, competition, bugbounty program, etc.
This advanced session will cover topics on how to leverage both CFML and ORM to start creating amazing applications that will be as lethal as a dinosaur riding a shark with an Uzi. We will cover ORM session management, virtual service layers, dynamic finders, dynamic counters and an enhanced Hibernate Criteria builder to create easy and programmatic HQL queries.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
5. ORM? JPA?
• ORM: Object/Relational Mapping
– Persistence: Data objects outlive the JVM app
– Maps Java POJOs to relational databases
– Supports OO concepts: inheritance, object identity, etc.
– Navigate data by walking the object graph, not the explicit
relational model
• JPA: Java Persistence API
• Hibernate ORM provides its own native API, in
addition to full JPA support
• Annotations and XML
7. Caveats
• No “one strategy to rule them all”
• Varies greatly between apps
• Important to understand concepts, then
apply as necessary
• Does not replace database tuning!
8. First, the antithesis:
public User get(String username) {
final Session session = openSession();
session.getTransaction().begin();
final User user = (User) session.get( User.class, username );
session.getTransaction().commit();
return user;
}
public boolean login(String username) {
return get(username) != null;
}
Clean? Yes. But...
9. EAGER Demo
• Prototypes start “simple”
– EAGER
– No caching
– Overuse of the kitchen sink
• DAO looks clean
• Then you see the SQL logs
13. Fetch Timing: EAGER
•
•
•
•
Immediate
Can be convenient (in some ways)
Significantly increases payload
Enormous amount of unnecessary
fetches for deep association tree
14. Fetch Timing: LAZY
• Fetched when first accessed
• Collections
– LAZY by default
– Utilizes Hibernate's internal concept of “persistent
collections”
– DEMO
• Single attribute (basic)
– Requires bytecode enhancement
– Not typically used nor beneficial
15. Fetch Timing: LAZY (cont'd)
• Single (ToOne) associations
– Fetched when accessed
– Proxy
• Default
• Fetched when accessed (except ID)
• Handled internally by Hibernate
– No-proxy
• Fetched when accessed (including ID)
• No visible proxy
• Requires buildtime bytecode enhancement
16. Fetch Timing: EXTRA LAZY
•
•
•
•
Collections only
Fetch individual elements as accessed
Does not fetch entire collection
DEMO
18. Fetch Style: JOIN
• Join fetch (left/outer join)
• Great for ToOne associations
• Multiple collection joins
– Possible for non-bags
– Warning: Cartesian product! SELECT is
normally faster
• DEMO
19. Fetch Style: SELECT
• Follow-up selects
• Default style for collections (avoids
cartesian products)
• Can result in 1+N selects (fetch per
collection entry)
• DEMO
20. Fetch Style: BATCH
• Fetches multiple entries when one is
accessed
• Configurable on both class and collection
levels (“batch-size”)
• Simple select and list of keys
• Multiple algorithms (new as of 4.2)
• Determines # of entries to fetch, based on
# of provided keys
21. Fetch Style: BATCH (cont'd)
• Legacy: pre-determined sizes, rounded
down
– batch-size==25, 24 elements in collection
– Fetches -> 12, 10, 2
• Padded: same as Legacy, size rounded up
• Dynamic: builds SQL for the # of keys,
limited by “batch-size”
• DEMO
22. Fetch Style: SUBSELECT
• Follow-up select
• Fetches all collection entries when
accessed for the 1st time
• Original root entry select used as
subselect
• Performance depends on the DB itself
• DEMO
23. Fetch Style: PROFILE
• named profile defining fetch styles
• “activated” through the Session
27. 2LC
• differs from the 1st level (Session)
• SessionFactory level (JVM)
• can scale horizontally on commodity
hardware (clustered)
• multiple providers
• currently focus on Infinispan (JBoss) &
EHCache (Terracotta)
28. 2LC (cont'd)
• disabled by default
– can enable globally (not recommended)
– enable for individual entities and
collections
– configurable at the Session level w/
CacheMode
• cache all properties (default) or only
non-lazy
29. 2LC (cont'd)
• Since JVM-level, concurrency is an issue
• Concurrency strategies
– Read only: simplest and optimal
– Read-write
• Supports updates
• Should not use for serializable transaction isolation
– Nonstrict-read-write
• If updates are occasional and unlikely to collide
• No strict transaction isolation
– Transactional:
• Fully transactional cache providers (ie, Infinispan and EHCache)
• JTA required
32. Query Cache
• Caches query result sets
• Repetitive queries with identical params
• Different from an entity cache
– Does not maintain entity state
– Holds on to sets of identifiers
• If used, best in conjunction with 2LC
33. Query Cache (cont'd)
• Disabled by default
• Many applications do not gain anything
• Queries invalidated upon relevant
updates
• Increases overhead by some: tracks
when to invalidate based on commits
• DEMO
35. Cache Management
• Entities stored in Session cache when saved,
updated, or retrieved
• Session#flush syncs all cached with DB
– Minimize usage
• Manage memory:
– Session#evict(entity) when no longer needed
– Session#clear for all
– Important for large dataset handling
• Same for 2LC, but methods on
SessionFactory#getCache
37. Bytecode Enhancement
• Not just for no-proxy, ToOne laziness
• Reduced load on PersistenceContext
– EntityEntry
• Internally provides state & Session association
• “Heavy” operation and typically a hotspot (multiple Maps)
– ManagedEntity
• Reduced memory and CPU loads
• Entities maintain their own state with bytecode enhancement
• (ManagedEntity)entity.$$_hibernate_getEntityEntry();
– 3 ways:
• Entity implements ManagedEntity and maintains the association
• Buildtime instrumentation (Ant and recently Gradle/Maven)
• Runtime instrumentation
38. Bytecode (cont'd)
• dirtiness checking
– Legacy: “dirtiness” determined by deep comparison of
entity state
– Enhancement: entity tracks its own dirtiness
– Simply check the flag (no deep comparison)
– Already mentioned…
• Minimize amount of flushes to begin with
• Minimize the # of entities in the cache -- evict when possible
• Many additional bytecode improvements planned
40. Hibernate Search
• Full-text search on the DB
– Bad performance
– CPU/IO overhead
• Offload full-text queries to Hibernate
Search engine
– Fully indexed
– Horizontally scalable
• Based on Apache Lucene
41. Hibernate Search (cont'd)
• Annotate entities with @Indexed
• Annotate properties with @Field
– Index the text: index=Index.YES
– “Analyze” the text: analyze=Analyze.YES
•
•
•
•
Lucene analyzer
Chunks sentences into words
Lowercase all of them
Exclude common words (“a”, “the”)
• Combo of indexing and analysis == performant
full-text searches!
43. Misc. Tips
• Easy to overlook unintended fetches
– Ex: Fully implemented toString with all
associations (fetches everything simply for
logging)
• Use @Immutable when possible
– Excludes entity from dirtiness checks
– Other internal optimizations
44. Misc. Tips (cont'd)
• Use Bag or List for inverse collections, not Set
– Collection#add & #addAll always return true (don't
need to check for pre-existing values)
– I.e., can add a value without fetching the collection
Parent p = (Parent) session.load(Parent.class, id);
Child c = new Child();
c.setParent(p);
p.addChild(c);
...
// does *not* fetch the collection
p.getChildren().add(c);
45. Misc. Tips (cont'd)
• One-shot delete (non-inverse collections)
– Scenario: 20 elements, need to delete 18 & add 3
– Default: Hibernate would delete the 18 one-byone, then add the 3
– Instead:
• Discard the entire collection (deletes all elements)
• Save a new collection with 5 elements
• 1 bulk delete SQL and 5 inserts
– Important concept for large amounts of data