Hibernate SVN: r18523 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override.
by hibernate-commits๏ผ lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2010-01-12 15:19:32 -0500 (Tue, 12 Jan 2010)
New Revision: 18523
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/PhoneNumber.java
Log:
HHH-4679 Make sure @AssociationOverride support the dot notation.
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/PhoneNumber.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/PhoneNumber.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/PhoneNumber.java 2010-01-12 20:19:32 UTC (rev 18523)
@@ -0,0 +1,45 @@
+package org.hibernate.test.annotations.override;
+
+import org.hibernate.test.annotations.override.Employee;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import java.util.Collection;
+
+@Entity
+public class PhoneNumber {
+
+ @Id
+ int id;
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ int number;
+
+ @ManyToMany(mappedBy = "contactInfo.phoneNumbers", cascade = CascadeType.ALL)
+ Collection<Employee> employees;
+
+ public Collection<Employee> getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(Collection<Employee> employees) {
+ this.employees = employees;
+ }
+
+ public int getNumber() {
+ return number;
+ }
+
+ public void setNumber(int number) {
+ this.number = number;
+ }
+
+ public int getId() {
+ return id;
+ }
+}
14ย years, 4ย months
Hibernate SVN: r18522 - in core/trunk/annotations/src: test/java/org/hibernate/test/annotations/access/xml and 1 other directories.
by hibernate-commits๏ผ lists.jboss.org
Author: hardy.ferentschik
Date: 2010-01-12 15:14:31 -0500 (Tue, 12 Jan 2010)
New Revision: 18522
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Boy.java
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Boy.xml
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java
Log:
HHH-4691 - xml access type support for element collection. As side effect started to suport element-collection in xml. Needs to be completed though.
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2010-01-12 19:44:37 UTC (rev 18521)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2010-01-12 20:14:31 UTC (rev 18522)
@@ -372,6 +372,7 @@
getAssociation( OneToOne.class, annotationList, defaults );
getAssociation( OneToMany.class, annotationList, defaults );
getAssociation( ManyToMany.class, annotationList, defaults );
+ getElementCollection( annotationList, defaults );
addIfNotNull( annotationList, getSequenceGenerator( elementsForProperty, defaults ) );
addIfNotNull( annotationList, getTableGenerator( elementsForProperty, defaults ) );
addIfNotNull( annotationList, getAttributeOverrides( elementsForProperty, defaults ) );
@@ -647,22 +648,7 @@
for (Element element : elementsForProperty) {
if ( xmlName.equals( element.getName() ) ) {
AnnotationDescriptor ad = new AnnotationDescriptor( annotationType );
- String className = element.attributeValue( "target-entity" );
- if ( className != null ) {
- Class clazz;
- try {
- clazz = ReflectHelper.classForName(
- XMLContext.buildSafeClassName( className, defaults ),
- this.getClass()
- );
- }
- catch (ClassNotFoundException e) {
- throw new AnnotationException(
- "Unable to find " + element.getPath() + "target-entity: " + className, e
- );
- }
- ad.setValue( "targetEntity", clazz );
- }
+ addTargetClass( element, ad, "target-entity", defaults );
getFetchType( ad, element );
getCascades( ad, element, defaults );
getJoinTable( annotationList, element, defaults );
@@ -785,6 +771,38 @@
}
}
+ private void addTargetClass(Element element, AnnotationDescriptor ad, String nodeName, XMLContext.Default defaults) {
+ String className = element.attributeValue( nodeName );
+ if ( className != null ) {
+ Class clazz;
+ try {
+ clazz = ReflectHelper.classForName(
+ XMLContext.buildSafeClassName( className, defaults ),
+ this.getClass()
+ );
+ }
+ catch (ClassNotFoundException e) {
+ throw new AnnotationException(
+ "Unable to find " + element.getPath() + " " + nodeName + ": " + className, e
+ );
+ }
+ ad.setValue( getJavaAttributeNameFromXMLOne(nodeName), clazz );
+ }
+ }
+
+ // TODO: Complete parsing of all element-collection related xml
+ private void getElementCollection(List<Annotation> annotationList, XMLContext.Default defaults) {
+ for ( Element element : elementsForProperty ) {
+ if ( "element-collection".equals( element.getName() ) ) {
+ AnnotationDescriptor ad = new AnnotationDescriptor( ElementCollection.class );
+ addTargetClass( element, ad, "target-class", defaults );
+ annotationList.add( AnnotationFactory.create( ad ) );
+
+ getAccessType( annotationList, element );
+ }
+ }
+ }
+
private void getOrderBy(List<Annotation> annotationList, Element element) {
Element subelement = element != null ? element.element( "order-by" ) : null;
if ( subelement != null ) {
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Boy.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Boy.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Boy.java 2010-01-12 20:14:31 UTC (rev 18522)
@@ -0,0 +1,54 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import java.util.Set;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+import org.hibernate.annotations.Entity;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Boy {
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private Set<String> nickNames;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public Set<String> getNickNames() {
+ return nickNames;
+ }
+
+ public void setNickNames(Set<String> nickNames) {
+ this.nickNames = nickNames;
+ }
+}
+
+
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java 2010-01-12 19:44:37 UTC (rev 18521)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java 2010-01-12 20:14:31 UTC (rev 18522)
@@ -143,12 +143,22 @@
List<Class<?>> classes = new ArrayList<Class<?>>();
classes.add( classUnderTest );
classes.add( Knive.class );
- List<String> configFiles = new ArrayList<String>();
+ List<String> configFiles = new ArrayList<String>();
configFiles.add( "org/hibernate/test/annotations/access/xml/Cook.xml" );
SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
}
+ public void testAccessOnElementCollectionXmlElement() throws Exception {
+ Class<?> classUnderTest = Boy.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ List<String> configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Boy.xml" );
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
private SessionFactoryImplementor buildSessionFactory(List<Class<?>> classesUnderTest, List<String> configFiles) {
assert classesUnderTest != null;
assert configFiles != null;
Copied: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Boy.xml (from rev 18519, core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml)
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Boy.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Boy.xml 2010-01-12 20:14:31 UTC (rev 18522)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <entity class="Boy" metadata-complete="false">
+ <attributes>
+ <element-collection name="nickNames" target-class="java.lang.String" access="PROPERTY"/>
+ </attributes>
+ </entity>
+</entity-mappings>
14ย years, 4ย months
Hibernate SVN: r18521 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override.
by hibernate-commits๏ผ lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2010-01-12 14:44:37 -0500 (Tue, 12 Jan 2010)
New Revision: 18521
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java
Log:
HHH-4679 Make sure @AssociationOverride support the dot notation.
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java 2010-01-12 19:40:17 UTC (rev 18520)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java 2010-01-12 19:44:37 UTC (rev 18521)
@@ -58,10 +58,10 @@
ContactInfo ci = new ContactInfo();
Addr address = new Addr();
address.setCity("Boston");
- //address.setCountry("USA");
+ address.setCountry("USA");
address.setState("MA");
address.setStreet("27 School Street");
- //address.setZipcode("02108");
+ address.setZipcode("02108");
ci.setAddr(address);
List<PhoneNumber> phoneNumbers = new ArrayList();
PhoneNumber num = new PhoneNumber();
14ย years, 4ย months
Hibernate SVN: r18520 - in core/trunk/annotations/src/test/java/org/hibernate/test/annotations: override and 1 other directory.
by hibernate-commits๏ผ lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2010-01-12 14:40:17 -0500 (Tue, 12 Jan 2010)
New Revision: 18520
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Addr.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/ContactInfo.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Employee.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialSite.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialTouchPoints.java
Removed:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Address.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java
Log:
HHH-4679 Make sure @AssociationOverride support the dot notation. Package name change.
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,67 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-
-@Entity
-public class Address {
-
- @Id
- int id;
-
- private String street;
- private String city;
- private String state;
- private String country;
- private String zipcode;
-
- public String getStreet() {
- return street;
- }
-
- public void setStreet(String street) {
- this.street = street;
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public String getZipcode() {
- return zipcode;
- }
-
- public void setZipcode(String zipcode) {
- this.zipcode = zipcode;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
-}
\ No newline at end of file
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,74 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import junit.framework.Assert;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.hibernate.test.annotations.TestCase;
-import org.hibernate.test.util.SchemaUtil;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class AssociationOverrideTest extends TestCase {
-
- public void testDottedNotation() throws Exception {
- assertTrue( SchemaUtil.isTablePresent( "Employee", getCfg() ) );
- assertTrue( "Overridden @JoinColumn fails",
- SchemaUtil.isColumnPresent( "Employee", "fld_address_fk", getCfg() ) );
-
- assertTrue( "Overridden @JoinTable name fails", SchemaUtil.isTablePresent( "tbl_empl_sites", getCfg() ) );
- assertTrue( "Overridden @JoinTable with default @JoinColumn fails",
- SchemaUtil.isColumnPresent( "tbl_empl_sites", "employee_id", getCfg() ) );
- assertTrue( "Overridden @JoinTable.inverseJoinColumn fails",
- SchemaUtil.isColumnPresent( "tbl_empl_sites", "to_website_fk", getCfg() ) );
-
- Session s = openSession();
- Transaction tx = s.beginTransaction();
- ContactInfo ci = new ContactInfo();
- Address address = new Address();
- address.setCity("Boston");
- address.setCountry("USA");
- address.setState("MA");
- address.setStreet("27 School Street");
- address.setZipcode("02108");
- ci.setAddress(address);
- List<PhoneNumber> phoneNumbers = new ArrayList();
- PhoneNumber num = new PhoneNumber();
- num.setNumber(5577188);
- Employee e = new Employee();
- Collection employeeList = new ArrayList();
- employeeList.add(e);
- e.setContactInfo(ci);
- num.setEmployees(employeeList);
- phoneNumbers.add(num);
- ci.setPhoneNumbers(phoneNumbers);
- SocialTouchPoints socialPoints = new SocialTouchPoints();
- List<SocialSite> sites = new ArrayList<SocialSite>();
- SocialSite site = new SocialSite();
- site.setEmployee(employeeList);
- site.setWebsite("www.jboss.org");
- sites.add(site);
- socialPoints.setWebsite(sites);
- ci.setSocial(socialPoints);
- s.persist(e);
- tx.commit();
-
- tx = s.beginTransaction();
- s.clear();
- e = (Employee) s.get(Employee.class,e.getId());
- tx.commit();
- s.close();
- }
-
- protected Class[] getMappings() {
- return new Class[] {
- Employee.class,
- PhoneNumber.class,
- Address.class,
- SocialSite.class,
- SocialTouchPoints.class
- };
- }
-
-}
\ No newline at end of file
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,49 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Embeddable;
-import javax.persistence.Embedded;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import java.util.List;
-
-
-@Embeddable
-public class ContactInfo {
- @ManyToOne(cascade = CascadeType.ALL)
- @JoinColumn(name="address_id_fk")
- Address address;
-
- @ManyToMany(cascade = CascadeType.ALL)
- List<PhoneNumber> phoneNumbers;
-
- @Embedded
- SocialTouchPoints social;
-
- public Address getAddress() {
- return address;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
- public List<PhoneNumber> getPhoneNumbers() {
- return phoneNumbers;
- }
-
- public void setPhoneNumbers(List<PhoneNumber> phoneNumbers) {
- this.phoneNumbers = phoneNumbers;
- }
-
- public SocialTouchPoints getSocial() {
- return social;
- }
-
- public void setSocial(SocialTouchPoints social) {
- this.social = social;
- }
-
-}
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,55 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import javax.persistence.AssociationOverride;
-import javax.persistence.AssociationOverrides;
-import javax.persistence.Embedded;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-
-@Entity
-public class Employee {
- @Id
- int id;
-
- @AssociationOverrides({
- @AssociationOverride(
- name = "social.website",
- joinTable = @JoinTable(
- name = "tbl_empl_sites",
- inverseJoinColumns = @JoinColumn(name = "to_website_fk")
- )
- ),
- @AssociationOverride(
- name = "phoneNumbers",
- joinTable = @JoinTable(
- name = "tbl_empl_phone"
- )
- ),
- @AssociationOverride(
- name="address",
- joinColumns = @JoinColumn(name="fld_address_fk")
- )
- })
- @Embedded
- ContactInfo contactInfo;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public ContactInfo getContactInfo() {
- return contactInfo;
- }
-
- public void setContactInfo(ContactInfo contactInfo) {
- this.contactInfo = contactInfo;
- }
-
-}
-
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,43 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToMany;
-import java.util.Collection;
-
-@Entity
-public class PhoneNumber {
-
- @Id
- int id;
-
- public void setId(int id) {
- this.id = id;
- }
-
- int number;
-
- @ManyToMany(mappedBy = "contactInfo.phoneNumbers", cascade = CascadeType.ALL)
- Collection<Employee> employees;
-
- public Collection<Employee> getEmployees() {
- return employees;
- }
-
- public void setEmployees(Collection<Employee> employees) {
- this.employees = employees;
- }
-
- public int getNumber() {
- return number;
- }
-
- public void setNumber(int number) {
- this.number = number;
- }
-
- public int getId() {
- return id;
- }
-}
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,42 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToMany;
-import java.util.Collection;
-
-@Entity
-public class SocialSite {
-
- @Id
- int id;
-
- String website;
-
- @ManyToMany(mappedBy="contactInfo.social.website")
- Collection<Employee> employee;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getWebsite() {
- return website;
- }
-
- public void setWebsite(String website) {
- this.website = website;
- }
-
- public Collection<Employee> getEmployee() {
- return employee;
- }
-
- public void setEmployee(Collection<Employee> employee) {
- this.employee = employee;
- }
-}
Deleted: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -1,22 +0,0 @@
-package org.hibernate.test.annotations.collectionelement;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Embeddable;
-import javax.persistence.ManyToMany;
-import java.util.List;
-
-@Embeddable
-public class SocialTouchPoints {
-
- // owning side of many to many
- @ManyToMany(cascade= CascadeType.ALL)
- List<SocialSite> website;
-
- public List<SocialSite> getWebsite() {
- return website;
- }
-
- public void setWebsite(List<SocialSite> website) {
- this.website = website;
- }
-}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Addr.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Addr.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Addr.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -0,0 +1,67 @@
+package org.hibernate.test.annotations.override;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+
+@Entity
+public class Addr {
+
+ @Id
+ int id;
+
+ private String street;
+ private String city;
+ private String state;
+ private String country;
+ private String zipcode;
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getZipcode() {
+ return zipcode;
+ }
+
+ public void setZipcode(String zipcode) {
+ this.zipcode = zipcode;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+}
\ No newline at end of file
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Address.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Address.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Address.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -11,4 +11,29 @@
public String street;
public String city;
public String state;
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getStreet() {
+
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
}
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java 2010-01-12 18:50:42 UTC (rev 18519)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/AssociationOverrideTest.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -5,7 +5,12 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.test.annotations.TestCase;
+import org.hibernate.test.util.SchemaUtil;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
/**
* @author Emmanuel Bernard
*/
@@ -37,11 +42,65 @@
}
}
+ public void testDottedNotation() throws Exception {
+ assertTrue( SchemaUtil.isTablePresent( "Employee", getCfg() ) );
+ assertTrue( "Overridden @JoinColumn fails",
+ SchemaUtil.isColumnPresent( "Employee", "fld_address_fk", getCfg() ) );
+
+ assertTrue( "Overridden @JoinTable name fails", SchemaUtil.isTablePresent( "tbl_empl_sites", getCfg() ) );
+ assertTrue( "Overridden @JoinTable with default @JoinColumn fails",
+ SchemaUtil.isColumnPresent( "tbl_empl_sites", "employee_id", getCfg() ) );
+ assertTrue( "Overridden @JoinTable.inverseJoinColumn fails",
+ SchemaUtil.isColumnPresent( "tbl_empl_sites", "to_website_fk", getCfg() ) );
+
+ Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ ContactInfo ci = new ContactInfo();
+ Addr address = new Addr();
+ address.setCity("Boston");
+ //address.setCountry("USA");
+ address.setState("MA");
+ address.setStreet("27 School Street");
+ //address.setZipcode("02108");
+ ci.setAddr(address);
+ List<PhoneNumber> phoneNumbers = new ArrayList();
+ PhoneNumber num = new PhoneNumber();
+ num.setNumber(5577188);
+ Employee e = new Employee();
+ Collection employeeList = new ArrayList();
+ employeeList.add(e);
+ e.setContactInfo(ci);
+ num.setEmployees(employeeList);
+ phoneNumbers.add(num);
+ ci.setPhoneNumbers(phoneNumbers);
+ SocialTouchPoints socialPoints = new SocialTouchPoints();
+ List<SocialSite> sites = new ArrayList<SocialSite>();
+ SocialSite site = new SocialSite();
+ site.setEmployee(employeeList);
+ site.setWebsite("www.jboss.org");
+ sites.add(site);
+ socialPoints.setWebsite(sites);
+ ci.setSocial(socialPoints);
+ s.persist(e);
+ tx.commit();
+
+ tx = s.beginTransaction();
+ s.clear();
+ e = (Employee) s.get(Employee.class,e.getId());
+ tx.commit();
+ s.close();
+ }
+
protected Class[] getMappings() {
return new Class[]{
+ Employee.class,
Location.class,
Move.class,
- Trip.class
+ Trip.class,
+ PhoneNumber.class,
+ Addr.class,
+ SocialSite.class,
+ SocialTouchPoints.class
};
}
}
Copied: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/ContactInfo.java (from rev 18519, core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java)
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/ContactInfo.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/ContactInfo.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -0,0 +1,48 @@
+package org.hibernate.test.annotations.override;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Embeddable;
+import javax.persistence.Embedded;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import java.util.List;
+
+
+@Embeddable
+public class ContactInfo {
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name="address_id_fk")
+ Addr address;
+
+ @ManyToMany(cascade = CascadeType.ALL)
+ List<PhoneNumber> phoneNumbers;
+
+ @Embedded
+ SocialTouchPoints social;
+
+ public Addr getAddress() {
+ return address;
+ }
+
+ public void setAddr(Addr address) {
+ this.address = address;
+ }
+
+ public List<PhoneNumber> getPhoneNumbers() {
+ return phoneNumbers;
+ }
+
+ public void setPhoneNumbers(List<PhoneNumber> phoneNumbers) {
+ this.phoneNumbers = phoneNumbers;
+ }
+
+ public SocialTouchPoints getSocial() {
+ return social;
+ }
+
+ public void setSocial(SocialTouchPoints social) {
+ this.social = social;
+ }
+
+}
Copied: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Employee.java (from rev 18519, core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java)
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Employee.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/Employee.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -0,0 +1,55 @@
+package org.hibernate.test.annotations.override;
+
+import javax.persistence.AssociationOverride;
+import javax.persistence.AssociationOverrides;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+
+@Entity
+public class Employee {
+ @Id
+ int id;
+
+ @AssociationOverrides({
+ @AssociationOverride(
+ name = "social.website",
+ joinTable = @JoinTable(
+ name = "tbl_empl_sites",
+ inverseJoinColumns = @JoinColumn(name = "to_website_fk")
+ )
+ ),
+ @AssociationOverride(
+ name = "phoneNumbers",
+ joinTable = @JoinTable(
+ name = "tbl_empl_phone"
+ )
+ ),
+ @AssociationOverride(
+ name="address",
+ joinColumns = @JoinColumn(name="fld_address_fk")
+ )
+ })
+ @Embedded
+ ContactInfo contactInfo;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public ContactInfo getContactInfo() {
+ return contactInfo;
+ }
+
+ public void setContactInfo(ContactInfo contactInfo) {
+ this.contactInfo = contactInfo;
+ }
+
+}
+
Copied: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialSite.java (from rev 18519, core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java)
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialSite.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialSite.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -0,0 +1,42 @@
+package org.hibernate.test.annotations.override;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import java.util.Collection;
+
+@Entity
+public class SocialSite {
+
+ @Id
+ int id;
+
+ String website;
+
+ @ManyToMany(mappedBy="contactInfo.social.website")
+ Collection<Employee> employee;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getWebsite() {
+ return website;
+ }
+
+ public void setWebsite(String website) {
+ this.website = website;
+ }
+
+ public Collection<Employee> getEmployee() {
+ return employee;
+ }
+
+ public void setEmployee(Collection<Employee> employee) {
+ this.employee = employee;
+ }
+}
Copied: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialTouchPoints.java (from rev 18519, core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java)
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialTouchPoints.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/override/SocialTouchPoints.java 2010-01-12 19:40:17 UTC (rev 18520)
@@ -0,0 +1,24 @@
+package org.hibernate.test.annotations.override;
+
+import org.hibernate.test.annotations.override.SocialSite;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Embeddable;
+import javax.persistence.ManyToMany;
+import java.util.List;
+
+@Embeddable
+public class SocialTouchPoints {
+
+ // owning side of many to many
+ @ManyToMany(cascade= CascadeType.ALL)
+ List<SocialSite> website;
+
+ public List<SocialSite> getWebsite() {
+ return website;
+ }
+
+ public void setWebsite(List<SocialSite> website) {
+ this.website = website;
+ }
+}
14ย years, 4ย months
Hibernate SVN: r18519 - in core/trunk/annotations/src: test/java/org/hibernate/test/annotations/access/xml and 1 other directories.
by hibernate-commits๏ผ lists.jboss.org
Author: hardy.ferentschik
Date: 2010-01-12 13:50:42 -0500 (Tue, 12 Jan 2010)
New Revision: 18519
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Cook.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Knive.java
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Cook.xml
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml
Log:
HHH-4691 - xml access type support for embedded-id and embedded
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2010-01-12 18:48:42 UTC (rev 18518)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2010-01-12 18:50:42 UTC (rev 18519)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
@@ -839,6 +839,7 @@
if ( "embedded".equals( element.getName() ) ) {
AnnotationDescriptor ad = new AnnotationDescriptor( Embedded.class );
annotationList.add( AnnotationFactory.create( ad ) );
+ getAccessType( annotationList, element );
}
}
if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
@@ -985,6 +986,7 @@
addIfNotNull( annotationList, annotation );
AnnotationDescriptor ad = new AnnotationDescriptor( EmbeddedId.class );
annotationList.add( AnnotationFactory.create( ad ) );
+ getAccessType( annotationList, element );
}
}
}
Copied: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Cook.java (from rev 18515, core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Waiter.java)
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Cook.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Cook.java 2010-01-12 18:50:42 UTC (rev 18519)
@@ -0,0 +1,51 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Cook {
+ @Id
+ @GeneratedValue
+ private int id;
+
+ private Knive favouriteKnife;
+
+ public Knive getFavouriteKnife() {
+ return favouriteKnife;
+ }
+
+ public void setFavouriteKnife(Knive favouriteKnife) {
+ this.favouriteKnife = favouriteKnife;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Knive.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Knive.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Knive.java 2010-01-12 18:50:42 UTC (rev 18519)
@@ -0,0 +1,46 @@
+// $Id: Waiter.java 18506 2010-01-11 20:23:08Z hardy.ferentschik $
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.Embeddable;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Embeddable
+public class Knive {
+ private String brand;
+
+ private int bladeLength;
+
+ public int getBladeLength() {
+ return bladeLength;
+ }
+
+ public void setBladeLength(int bladeLength) {
+ this.bladeLength = bladeLength;
+ }
+
+ public String getBrand() {
+ return brand;
+ }
+
+ public void setBrand(String brand) {
+ this.brand = brand;
+ }
+}
\ No newline at end of file
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java 2010-01-12 18:48:42 UTC (rev 18518)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java 2010-01-12 18:50:42 UTC (rev 18519)
@@ -60,7 +60,7 @@
// now with an additional xml configuration file changing the default access type for Tourist using basic
configFiles = new ArrayList<String>();
- configFiles.add("org/hibernate/test/annotations/access/xml/Tourist.xml");
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Tourist.xml" );
factory = buildSessionFactory( classes, configFiles );
assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
}
@@ -120,7 +120,7 @@
Class<?> classUnderTest = Waiter.class;
List<Class<?>> classes = new ArrayList<Class<?>>();
classes.add( classUnderTest );
- classes.add(Crew.class);
+ classes.add( Crew.class );
List<String> configFiles = new ArrayList<String>();
configFiles.add( "org/hibernate/test/annotations/access/xml/Crew.xml" );
SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
@@ -131,13 +131,24 @@
Class<?> classUnderTest = RentalCar.class;
List<Class<?>> classes = new ArrayList<Class<?>>();
classes.add( classUnderTest );
- classes.add(Driver.class);
+ classes.add( Driver.class );
List<String> configFiles = new ArrayList<String>();
configFiles.add( "org/hibernate/test/annotations/access/xml/RentalCar.xml" );
SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
}
+ public void testAccessOnEmbeddedXmlElement() throws Exception {
+ Class<?> classUnderTest = Cook.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ classes.add( Knive.class );
+ List<String> configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Cook.xml" );
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
private SessionFactoryImplementor buildSessionFactory(List<Class<?>> classesUnderTest, List<String> configFiles) {
assert classesUnderTest != null;
assert configFiles != null;
@@ -153,6 +164,7 @@
}
// uses the first getter of the tupelizer for the assertions
+
private void assertAccessType(SessionFactoryImplementor factory, Class<?> classUnderTest, AccessType accessType) {
EntityMetamodel metaModel = factory.getEntityPersister( classUnderTest.getName() )
.getEntityMetamodel();
Copied: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Cook.xml (from rev 18515, core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml)
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Cook.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Cook.xml 2010-01-12 18:50:42 UTC (rev 18519)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <entity class="Cook" metadata-complete="false">
+ <attributes>
+ <embedded name="favouriteKnife" access="PROPERTY"/>
+ </attributes>
+ </entity>
+</entity-mappings>
Modified: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml 2010-01-12 18:48:42 UTC (rev 18518)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml 2010-01-12 18:50:42 UTC (rev 18519)
@@ -3,7 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
version="2.0">
- <description>Mapping for Crew entity</description>
<package>org.hibernate.test.annotations.access.xml</package>
<mapped-superclass class="Crew" metadata-complete="false" access="FIELD">
<attributes>
14ย years, 4ย months
Hibernate SVN: r18518 - in core/trunk/annotations/src: main/java/org/hibernate/cfg/annotations and 1 other directories.
by hibernate-commits๏ผ lists.jboss.org
Author: epbernard
Date: 2010-01-12 13:48:42 -0500 (Tue, 12 Jan 2010)
New Revision: 18518
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/PropertyHolder.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java
Log:
HHH-4782 supports @AssociationOverride.joinTable
HHH-4679 add tests for dot notations in @AssocuiationOverride
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -33,6 +33,7 @@
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
import javax.persistence.MappedSuperclass;
import org.hibernate.AssertionFailure;
@@ -50,9 +51,12 @@
private Map<String, Column[]> currentPropertyColumnOverride;
private Map<String, JoinColumn[]> holderJoinColumnOverride;
private Map<String, JoinColumn[]> currentPropertyJoinColumnOverride;
+ private Map<String, JoinTable> holderJoinTableOverride;
+ private Map<String, JoinTable> currentPropertyJoinTableOverride;
private String path;
private ExtendedMappings mappings;
+
public AbstractPropertyHolder(
String path, PropertyHolder parent, XClass clazzToProcess, ExtendedMappings mappings
) {
@@ -77,6 +81,7 @@
if ( property == null ) {
this.currentPropertyColumnOverride = null;
this.currentPropertyJoinColumnOverride = null;
+ this.currentPropertyJoinTableOverride = null;
}
else {
this.currentPropertyColumnOverride = buildColumnOverride(
@@ -93,6 +98,13 @@
if ( this.currentPropertyJoinColumnOverride.size() == 0 ) {
this.currentPropertyJoinColumnOverride = null;
}
+ this.currentPropertyJoinTableOverride = buildJoinTableOverride(
+ property,
+ getPath()
+ );
+ if ( this.currentPropertyJoinTableOverride.size() == 0 ) {
+ this.currentPropertyJoinTableOverride = null;
+ }
}
}
@@ -111,6 +123,7 @@
// WARNING: this can conflict with user's expectations if:
// - the property uses some restricted values
// - the user has overridden the column
+ // also change getOverriddenJoinColumn and getOverriddenJoinTable as well
// if ( propertyName.contains( ".key." ) ) {
// //support for legacy @AttributeOverride declarations
@@ -149,7 +162,7 @@
* Get column overriding, property first, then parent, then holder
* find the overridden rules from the exact property name.
*/
- public Column[] getExactOverriddenColumn(String propertyName) {
+ private Column[] getExactOverriddenColumn(String propertyName) {
Column[] override = null;
if ( parent != null ) {
override = parent.getExactOverriddenColumn( propertyName );
@@ -165,8 +178,25 @@
/**
* Get column overriding, property first, then parent, then holder
+ * replace the placeholder 'collection&&element' with nothing
+ *
+ * These rules are here to support both JPA 2 and legacy overriding rules.
+ *
*/
public JoinColumn[] getOverriddenJoinColumn(String propertyName) {
+ JoinColumn[] result = getExactOverriddenJoinColumn( propertyName );
+ if ( result == null && propertyName.contains( ".collection&&element." ) ) {
+ //support for non map collections where no prefix is needed
+ //TODO cache the underlying regexp
+ result = getExactOverriddenJoinColumn( propertyName.replace( ".collection&&element.", "." ) );
+ }
+ return result;
+ }
+
+ /**
+ * Get column overriding, property first, then parent, then holder
+ */
+ private JoinColumn[] getExactOverriddenJoinColumn(String propertyName) {
JoinColumn[] override = null;
if ( parent != null ) {
override = parent.getOverriddenJoinColumn( propertyName );
@@ -180,26 +210,81 @@
return override;
}
+ /**
+ * Get column overriding, property first, then parent, then holder
+ * replace the placeholder 'collection&&element' with nothing
+ *
+ * These rules are here to support both JPA 2 and legacy overriding rules.
+ *
+ */
+ public JoinTable getJoinTable(XProperty property) {
+ final String propertyName = StringHelper.qualify( getPath(), property.getName() );
+ JoinTable result = getOverriddenJoinTable( propertyName );
+ if (result == null) {
+ result = property.getAnnotation( JoinTable.class );
+ }
+ return result;
+ }
+
+ /**
+ * Get column overriding, property first, then parent, then holder
+ * replace the placeholder 'collection&&element' with nothing
+ *
+ * These rules are here to support both JPA 2 and legacy overriding rules.
+ *
+ */
+ public JoinTable getOverriddenJoinTable(String propertyName) {
+ JoinTable result = getExactOverriddenJoinTable( propertyName );
+ if ( result == null && propertyName.contains( ".collection&&element." ) ) {
+ //support for non map collections where no prefix is needed
+ //TODO cache the underlying regexp
+ result = getExactOverriddenJoinTable( propertyName.replace( ".collection&&element.", "." ) );
+ }
+ return result;
+ }
+
+ /**
+ * Get column overriding, property first, then parent, then holder
+ */
+ private JoinTable getExactOverriddenJoinTable(String propertyName) {
+ JoinTable override = null;
+ if ( parent != null ) {
+ override = parent.getOverriddenJoinTable( propertyName );
+ }
+ if ( override == null && currentPropertyJoinColumnOverride != null ) {
+ override = currentPropertyJoinTableOverride.get( propertyName );
+ }
+ if ( override == null && holderJoinTableOverride != null ) {
+ override = holderJoinTableOverride.get( propertyName );
+ }
+ return override;
+ }
+
private void buildHierarchyColumnOverride(XClass element) {
XClass current = element;
Map<String, Column[]> columnOverride = new HashMap<String, Column[]>();
Map<String, JoinColumn[]> joinColumnOverride = new HashMap<String, JoinColumn[]>();
+ Map<String, JoinTable> joinTableOverride = new HashMap<String, JoinTable>();
while ( current != null && !mappings.getReflectionManager().toXClass( Object.class ).equals( current ) ) {
if ( current.isAnnotationPresent( Entity.class ) || current.isAnnotationPresent( MappedSuperclass.class )
|| current.isAnnotationPresent( Embeddable.class ) ) {
//FIXME is embeddable override?
Map<String, Column[]> currentOverride = buildColumnOverride( current, getPath() );
Map<String, JoinColumn[]> currentJoinOverride = buildJoinColumnOverride( current, getPath() );
+ Map<String, JoinTable> currentJoinTableOverride = buildJoinTableOverride( current, getPath() );
currentOverride.putAll( columnOverride ); //subclasses have precedence over superclasses
currentJoinOverride.putAll( joinColumnOverride ); //subclasses have precedence over superclasses
+ currentJoinOverride.putAll( joinColumnOverride ); //subclasses have precedence over superclasses
columnOverride = currentOverride;
joinColumnOverride = currentJoinOverride;
+ joinTableOverride = currentJoinTableOverride;
}
current = current.getSuperclass();
}
holderColumnOverride = columnOverride.size() > 0 ? columnOverride : null;
holderJoinColumnOverride = joinColumnOverride.size() > 0 ? joinColumnOverride : null;
+ holderJoinTableOverride = joinTableOverride.size() > 0 ? joinTableOverride : null;
}
private static Map<String, Column[]> buildColumnOverride(XAnnotatedElement element, String path) {
@@ -218,7 +303,7 @@
overrides = null;
}
- //fill overriden columns
+ //fill overridden columns
if ( overrides != null ) {
for (AttributeOverride depAttr : overrides) {
columnOverride.put(
@@ -246,7 +331,7 @@
overrides = null;
}
- //fill overriden columns
+ //fill overridden columns
if ( overrides != null ) {
for (AssociationOverride depAttr : overrides) {
columnOverride.put(
@@ -258,6 +343,36 @@
return columnOverride;
}
+ private static Map<String, JoinTable> buildJoinTableOverride(XAnnotatedElement element, String path) {
+ Map<String, JoinTable> tableOverride = new HashMap<String, JoinTable>();
+ if ( element == null ) return tableOverride;
+ AssociationOverride singleOverride = element.getAnnotation( AssociationOverride.class );
+ AssociationOverrides multipleOverrides = element.getAnnotation( AssociationOverrides.class );
+ AssociationOverride[] overrides;
+ if ( singleOverride != null ) {
+ overrides = new AssociationOverride[] { singleOverride };
+ }
+ else if ( multipleOverrides != null ) {
+ overrides = multipleOverrides.value();
+ }
+ else {
+ overrides = null;
+ }
+
+ //fill overridden tables
+ if ( overrides != null ) {
+ for (AssociationOverride depAttr : overrides) {
+ if ( depAttr.joinColumns().length == 0 ) {
+ tableOverride.put(
+ StringHelper.qualify( path, depAttr.name() ),
+ depAttr.joinTable()
+ );
+ }
+ }
+ }
+ return tableOverride;
+ }
+
public void setParentProperty(String parentProperty) {
throw new AssertionFailure( "Setting the parent property to a non component" );
}
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -1234,8 +1234,8 @@
( property.isAnnotationPresent( ManyToOne.class )
|| property.isAnnotationPresent( OneToOne.class ) )
) {
- if ( property.isAnnotationPresent( JoinTable.class ) ) {
- JoinTable joinTableAnn = property.getAnnotation( JoinTable.class );
+ JoinTable joinTableAnn = propertyHolder.getJoinTable( property );
+ if ( joinTableAnn != null ) {
joinColumns = Ejb3JoinColumn.buildJoinColumns(
joinTableAnn.inverseJoinColumns(), null, entityBinder.getSecondaryTables(),
propertyHolder, inferredData.getPropertyName(), mappings
@@ -1412,7 +1412,7 @@
boolean ignoreNotFound = notFound != null && notFound.action().equals( NotFoundAction.IGNORE );
OnDelete onDeleteAnn = property.getAnnotation( OnDelete.class );
boolean onDeleteCascade = onDeleteAnn != null && OnDeleteAction.CASCADE.equals( onDeleteAnn.action() );
- JoinTable assocTable = property.getAnnotation( JoinTable.class );
+ JoinTable assocTable = propertyHolder.getJoinTable( property );
if ( assocTable != null ) {
Join join = propertyHolder.addJoin( assocTable, false );
for (Ejb3JoinColumn joinColumn : joinColumns) {
@@ -1447,7 +1447,7 @@
boolean ignoreNotFound = notFound != null && notFound.action().equals( NotFoundAction.IGNORE );
OnDelete onDeleteAnn = property.getAnnotation( OnDelete.class );
boolean onDeleteCascade = onDeleteAnn != null && OnDeleteAction.CASCADE.equals( onDeleteAnn.action() );
- JoinTable assocTable = property.getAnnotation( JoinTable.class );
+ JoinTable assocTable = propertyHolder.getJoinTable( property );
if ( assocTable != null ) {
Join join = propertyHolder.addJoin( assocTable, false );
for (Ejb3JoinColumn joinColumn : joinColumns) {
@@ -1477,7 +1477,7 @@
Cascade hibernateCascade = property.getAnnotation( Cascade.class );
OnDelete onDeleteAnn = property.getAnnotation( OnDelete.class );
boolean onDeleteCascade = onDeleteAnn != null && OnDeleteAction.CASCADE.equals( onDeleteAnn.action() );
- JoinTable assocTable = property.getAnnotation( JoinTable.class );
+ JoinTable assocTable = propertyHolder.getJoinTable( property );
if ( assocTable != null ) {
Join join = propertyHolder.addJoin( assocTable, false );
for (Ejb3JoinColumn joinColumn : joinColumns) {
@@ -1852,7 +1852,7 @@
TableBinder associationTableBinder = new TableBinder();
JoinColumn[] annJoins;
JoinColumn[] annInverseJoins;
- JoinTable assocTable = property.getAnnotation( JoinTable.class );
+ JoinTable assocTable = propertyHolder.getJoinTable( property );
CollectionTable collectionTable = property.getAnnotation( CollectionTable.class );
if ( assocTable != null || collectionTable != null ) {
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -647,4 +647,5 @@
mappings.getMappedSuperclass( mappings.getReflectionManager().toClass( declaringClass ) ) :
null;
}
+
}
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/PropertyHolder.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/PropertyHolder.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/PropertyHolder.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -27,6 +27,7 @@
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
+import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.mapping.Join;
import org.hibernate.mapping.KeyValue;
import org.hibernate.mapping.PersistentClass;
@@ -72,6 +73,14 @@
*/
JoinColumn[] getOverriddenJoinColumn(String propertyName);
+ /**
+ * return
+ * - null if no join table is present,
+ * - the join table if not overridden,
+ * - the overridden join table otherwise
+ */
+ JoinTable getJoinTable(XProperty property);
+
String getEntityName();
Join addJoin(JoinTable joinTableAnn, boolean noDelayInPkColumnCreation);
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -470,7 +470,7 @@
if (isMappedBy
&& (property.isAnnotationPresent( JoinColumn.class )
|| property.isAnnotationPresent( JoinColumns.class )
- || property.isAnnotationPresent( JoinTable.class ) ) ) {
+ || propertyHolder.getJoinTable( property ) != null ) ) {
String message = "Associations marked as mappedBy must not define database mappings like @JoinTable or @JoinColumn: ";
message += StringHelper.qualify( propertyHolder.getPath(), propertyName );
throw new AnnotationException( message );
@@ -1152,7 +1152,7 @@
);
}
else if ( anyAnn != null ) {
- if ( !property.isAnnotationPresent( JoinTable.class ) ) {
+ if ( parentPropertyHolder.getJoinTable( property ) == null ) {
String path = collValue.getOwnerEntityName() + "." + joinColumns[0].getPropertyName();
throw new AnnotationException(
"@JoinTable is mandatory when @ManyToAny is used: " + path
@@ -1160,7 +1160,7 @@
}
}
else {
- JoinTable joinTableAnn = property.getAnnotation( JoinTable.class );
+ JoinTable joinTableAnn = parentPropertyHolder.getJoinTable( property );
if ( joinTableAnn != null && joinTableAnn.inverseJoinColumns().length > 0 ) {
String path = collValue.getOwnerEntityName() + "." + joinColumns[0].getPropertyName();
throw new AnnotationException(
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -4,6 +4,7 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.test.annotations.TestCase;
+import org.hibernate.test.util.SchemaUtil;
import java.util.ArrayList;
import java.util.Collection;
@@ -12,6 +13,16 @@
public class AssociationOverrideTest extends TestCase {
public void testDottedNotation() throws Exception {
+ assertTrue( SchemaUtil.isTablePresent( "Employee", getCfg() ) );
+ assertTrue( "Overridden @JoinColumn fails",
+ SchemaUtil.isColumnPresent( "Employee", "fld_address_fk", getCfg() ) );
+
+ assertTrue( "Overridden @JoinTable name fails", SchemaUtil.isTablePresent( "tbl_empl_sites", getCfg() ) );
+ assertTrue( "Overridden @JoinTable with default @JoinColumn fails",
+ SchemaUtil.isColumnPresent( "tbl_empl_sites", "employee_id", getCfg() ) );
+ assertTrue( "Overridden @JoinTable.inverseJoinColumn fails",
+ SchemaUtil.isColumnPresent( "tbl_empl_sites", "to_website_fk", getCfg() ) );
+
Session s = openSession();
Transaction tx = s.beginTransaction();
ContactInfo ci = new ContactInfo();
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -3,6 +3,8 @@
import javax.persistence.CascadeType;
import javax.persistence.Embeddable;
import javax.persistence.Embedded;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import java.util.List;
@@ -10,10 +12,11 @@
@Embeddable
public class ContactInfo {
- @ManyToOne(targetEntity=Address.class, cascade=CascadeType.ALL)
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name="address_id_fk")
Address address;
- @ManyToMany(targetEntity=PhoneNumber.class, cascade=CascadeType.ALL)
+ @ManyToMany(cascade = CascadeType.ALL)
List<PhoneNumber> phoneNumbers;
@Embedded
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -10,34 +10,31 @@
@Entity
public class Employee {
- @Id
+ @Id
int id;
-/* @AssociationOverride(
- name="social.website",
- joinTable=@JoinTable(
- name="xxxwebsites",
- joinColumns=@JoinColumn(name="id"),
- inverseJoinColumns=@JoinColumn(name="id" )
- )
- )
-
- @AssociationOverride(
- name="social.website",
- joinColumns=@JoinColumn(name="id"))
-*/
-
- @AssociationOverride(
- name="social.website",
- joinTable=@JoinTable(
- name="xxxwebsites",
- joinColumns=@JoinColumn(name=""),
- inverseJoinColumns=@JoinColumn(name="id" )
- )
- )
- @Embedded
+ @AssociationOverrides({
+ @AssociationOverride(
+ name = "social.website",
+ joinTable = @JoinTable(
+ name = "tbl_empl_sites",
+ inverseJoinColumns = @JoinColumn(name = "to_website_fk")
+ )
+ ),
+ @AssociationOverride(
+ name = "phoneNumbers",
+ joinTable = @JoinTable(
+ name = "tbl_empl_phone"
+ )
+ ),
+ @AssociationOverride(
+ name="address",
+ joinColumns = @JoinColumn(name="fld_address_fk")
+ )
+ })
+ @Embedded
ContactInfo contactInfo;
-
+
public int getId() {
return id;
}
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -17,8 +17,8 @@
}
int number;
-
- @ManyToMany(mappedBy="contactInfo.phoneNumbers", cascade= CascadeType.ALL)
+
+ @ManyToMany(mappedBy = "contactInfo.phoneNumbers", cascade = CascadeType.ALL)
Collection<Employee> employees;
public Collection<Employee> getEmployees() {
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java 2010-01-12 18:37:19 UTC (rev 18517)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java 2010-01-12 18:48:42 UTC (rev 18518)
@@ -9,7 +9,7 @@
public class SocialTouchPoints {
// owning side of many to many
- @ManyToMany(targetEntity=SocialSite.class, cascade= CascadeType.ALL)
+ @ManyToMany(cascade= CascadeType.ALL)
List<SocialSite> website;
public List<SocialSite> getWebsite() {
14ย years, 4ย months
Hibernate SVN: r18517 - core/trunk/core.
by hibernate-commits๏ผ lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-12 13:37:19 -0500 (Tue, 12 Jan 2010)
New Revision: 18517
Modified:
core/trunk/core/pom.xml
Log:
HHH-4674 - JBoss has renamed its JACC artifact
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-01-12 18:15:37 UTC (rev 18516)
+++ core/trunk/core/pom.xml 2010-01-12 18:37:19 UTC (rev 18517)
@@ -50,8 +50,8 @@
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jacc-api_1.3</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <artifactId>jboss-jacc-api_JDK4</artifactId>
+ <version>1.1.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
14ย years, 4ย months
Hibernate SVN: r18516 - core/branches/Branch_3_3/core.
by hibernate-commits๏ผ lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-12 13:15:37 -0500 (Tue, 12 Jan 2010)
New Revision: 18516
Modified:
core/branches/Branch_3_3/core/pom.xml
Log:
HHH-4674 - JBoss has renamed its JACC artifact
Modified: core/branches/Branch_3_3/core/pom.xml
===================================================================
--- core/branches/Branch_3_3/core/pom.xml 2010-01-12 16:03:48 UTC (rev 18515)
+++ core/branches/Branch_3_3/core/pom.xml 2010-01-12 18:15:37 UTC (rev 18516)
@@ -50,13 +50,13 @@
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jacc-api</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <artifactId>jboss-jacc-api_JDK4</artifactId>
+ <version>1.1.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
- <groupId>jboss.web</groupId>
- <artifactId>servlet-api</artifactId>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-servlet-api_3.0</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
14ย years, 4ย months
Hibernate SVN: r18515 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement.
by hibernate-commits๏ผ lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2010-01-12 11:03:48 -0500 (Tue, 12 Jan 2010)
New Revision: 18515
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java
Log:
HHH-4679 Make sure @AssociationOverride support the dot notation
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Address.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,67 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+
+@Entity
+public class Address {
+
+ @Id
+ int id;
+
+ private String street;
+ private String city;
+ private String state;
+ private String country;
+ private String zipcode;
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getZipcode() {
+ return zipcode;
+ }
+
+ public void setZipcode(String zipcode) {
+ this.zipcode = zipcode;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/AssociationOverrideTest.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,63 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import junit.framework.Assert;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.test.annotations.TestCase;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class AssociationOverrideTest extends TestCase {
+
+ public void testDottedNotation() throws Exception {
+ Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ ContactInfo ci = new ContactInfo();
+ Address address = new Address();
+ address.setCity("Boston");
+ address.setCountry("USA");
+ address.setState("MA");
+ address.setStreet("27 School Street");
+ address.setZipcode("02108");
+ ci.setAddress(address);
+ List<PhoneNumber> phoneNumbers = new ArrayList();
+ PhoneNumber num = new PhoneNumber();
+ num.setNumber(5577188);
+ Employee e = new Employee();
+ Collection employeeList = new ArrayList();
+ employeeList.add(e);
+ e.setContactInfo(ci);
+ num.setEmployees(employeeList);
+ phoneNumbers.add(num);
+ ci.setPhoneNumbers(phoneNumbers);
+ SocialTouchPoints socialPoints = new SocialTouchPoints();
+ List<SocialSite> sites = new ArrayList<SocialSite>();
+ SocialSite site = new SocialSite();
+ site.setEmployee(employeeList);
+ site.setWebsite("www.jboss.org");
+ sites.add(site);
+ socialPoints.setWebsite(sites);
+ ci.setSocial(socialPoints);
+ s.persist(e);
+ tx.commit();
+
+ tx = s.beginTransaction();
+ s.clear();
+ e = (Employee) s.get(Employee.class,e.getId());
+ tx.commit();
+ s.close();
+ }
+
+ protected Class[] getMappings() {
+ return new Class[] {
+ Employee.class,
+ PhoneNumber.class,
+ Address.class,
+ SocialSite.class,
+ SocialTouchPoints.class
+ };
+ }
+
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/ContactInfo.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,46 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Embeddable;
+import javax.persistence.Embedded;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import java.util.List;
+
+
+@Embeddable
+public class ContactInfo {
+ @ManyToOne(targetEntity=Address.class, cascade=CascadeType.ALL)
+ Address address;
+
+ @ManyToMany(targetEntity=PhoneNumber.class, cascade=CascadeType.ALL)
+ List<PhoneNumber> phoneNumbers;
+
+ @Embedded
+ SocialTouchPoints social;
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public List<PhoneNumber> getPhoneNumbers() {
+ return phoneNumbers;
+ }
+
+ public void setPhoneNumbers(List<PhoneNumber> phoneNumbers) {
+ this.phoneNumbers = phoneNumbers;
+ }
+
+ public SocialTouchPoints getSocial() {
+ return social;
+ }
+
+ public void setSocial(SocialTouchPoints social) {
+ this.social = social;
+ }
+
+}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/Employee.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,58 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import javax.persistence.AssociationOverride;
+import javax.persistence.AssociationOverrides;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+
+@Entity
+public class Employee {
+ @Id
+ int id;
+
+/* @AssociationOverride(
+ name="social.website",
+ joinTable=@JoinTable(
+ name="xxxwebsites",
+ joinColumns=@JoinColumn(name="id"),
+ inverseJoinColumns=@JoinColumn(name="id" )
+ )
+ )
+
+ @AssociationOverride(
+ name="social.website",
+ joinColumns=@JoinColumn(name="id"))
+*/
+
+ @AssociationOverride(
+ name="social.website",
+ joinTable=@JoinTable(
+ name="xxxwebsites",
+ joinColumns=@JoinColumn(name=""),
+ inverseJoinColumns=@JoinColumn(name="id" )
+ )
+ )
+ @Embedded
+ ContactInfo contactInfo;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public ContactInfo getContactInfo() {
+ return contactInfo;
+ }
+
+ public void setContactInfo(ContactInfo contactInfo) {
+ this.contactInfo = contactInfo;
+ }
+
+}
+
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/PhoneNumber.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,43 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import java.util.Collection;
+
+@Entity
+public class PhoneNumber {
+
+ @Id
+ int id;
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ int number;
+
+ @ManyToMany(mappedBy="contactInfo.phoneNumbers", cascade= CascadeType.ALL)
+ Collection<Employee> employees;
+
+ public Collection<Employee> getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(Collection<Employee> employees) {
+ this.employees = employees;
+ }
+
+ public int getNumber() {
+ return number;
+ }
+
+ public void setNumber(int number) {
+ this.number = number;
+ }
+
+ public int getId() {
+ return id;
+ }
+}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialSite.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,42 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import java.util.Collection;
+
+@Entity
+public class SocialSite {
+
+ @Id
+ int id;
+
+ String website;
+
+ @ManyToMany(mappedBy="contactInfo.social.website")
+ Collection<Employee> employee;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getWebsite() {
+ return website;
+ }
+
+ public void setWebsite(String website) {
+ this.website = website;
+ }
+
+ public Collection<Employee> getEmployee() {
+ return employee;
+ }
+
+ public void setEmployee(Collection<Employee> employee) {
+ this.employee = employee;
+ }
+}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/collectionelement/SocialTouchPoints.java 2010-01-12 16:03:48 UTC (rev 18515)
@@ -0,0 +1,22 @@
+package org.hibernate.test.annotations.collectionelement;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Embeddable;
+import javax.persistence.ManyToMany;
+import java.util.List;
+
+@Embeddable
+public class SocialTouchPoints {
+
+ // owning side of many to many
+ @ManyToMany(targetEntity=SocialSite.class, cascade= CascadeType.ALL)
+ List<SocialSite> website;
+
+ public List<SocialSite> getWebsite() {
+ return website;
+ }
+
+ public void setWebsite(List<SocialSite> website) {
+ this.website = website;
+ }
+}
14ย years, 4ย months
Hibernate SVN: r18514 - core/trunk/documentation/manual/src/main/docbook/ko-KR/content.
by hibernate-commits๏ผ lists.jboss.org
Author: jdkim528
Date: 2010-01-12 09:38:09 -0500 (Tue, 12 Jan 2010)
New Revision: 18514
Modified:
core/trunk/documentation/manual/src/main/docbook/ko-KR/content/batch.po
Log:
translated!
Modified: core/trunk/documentation/manual/src/main/docbook/ko-KR/content/batch.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ko-KR/content/batch.po 2010-01-12 12:01:32 UTC (rev 18513)
+++ core/trunk/documentation/manual/src/main/docbook/ko-KR/content/batch.po 2010-01-12 14:38:09 UTC (rev 18514)
@@ -2,9 +2,9 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-07-14 19:55+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2010-01-12 23:26+0900\n"
+"PO-Revision-Date: 2010-01-12 23:37+0900\n"
+"Last-Translator: Jongdae Kim <jdkim528(a)korea.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -18,13 +18,9 @@
#. Tag: para
#: batch.xml:31
-#, fuzzy, no-c-format
-msgid ""
-"A naive approach to inserting 100,000 rows in the database using Hibernate "
-"might look like this:"
-msgstr ""
-"Hibernate๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด์์ 100 000 ๊ฐ์ ํ๋ค์ ์ฝ์
์ํค๋ ๋ณธ๋"
-"์ ์ ๊ทผ๋ฒ์ ๋ค์๊ณผ ๊ฐ๋ค:"
+#, no-c-format
+msgid "A naive approach to inserting 100,000 rows in the database using Hibernate might look like this:"
+msgstr "ํ์ด๋ฒ๋ค์ดํธ๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด์์ 100,000 ๊ฐ์ ํ๋ค์ ์ฝ์
์ํค๋ ์์ ์ ๊ทผ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ ์ ์๋ค:"
#. Tag: programlisting
#: batch.xml:36
@@ -39,78 +35,56 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"for ( int i=0; i<100000; i++ ) {\n"
+" Customer customer = new Customer(.....);\n"
+" session.save(customer);\n"
+"}\n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: para
#: batch.xml:38
-#, fuzzy, no-c-format
-msgid ""
-"This would fall over with an <literal>OutOfMemoryException</literal> "
-"somewhere around the 50,000th row. That is because Hibernate caches all the "
-"newly inserted <literal>Customer</literal> instances in the session-level "
-"cache. In this chapter we will show you how to avoid this problem."
-msgstr ""
-"์ด๊ฒ์ 50 000๋ฒ์งธ ํ ๊ฐ๊น์ด ๊ณณ์์ <literal>OutOfMemoryException</literal>์ผ"
-"๋ก ๋จ์ด์ง ๊ฒ์ด๋ค. ๊ทธ๊ฒ์ Hibernate๊ฐ session-level ์บ์ ์์ ๋ชจ๋ ์๋ก์ด ์ฝ์
"
-"๋ <literal>Customer</literal> ์ธ์คํด์ค๋ค์ ์บ์์ํค๊ธฐ ๋๋ฌธ์ด๋ค."
+#, no-c-format
+msgid "This would fall over with an <literal>OutOfMemoryException</literal> somewhere around the 50,000th row. That is because Hibernate caches all the newly inserted <literal>Customer</literal> instances in the session-level cache. In this chapter we will show you how to avoid this problem."
+msgstr "์ด๊ฒ์ 50 000๋ฒ์งธ ํ ๊ทผ์ฒ์์ <literal>OutOfMemoryException</literal>์ผ๋ก ๋จ์ด์ง ๊ฒ์ด๋ค. ๊ทธ๊ฒ์ ํ์ด๋ฒ๋ค์ดํธ๊ฐ ๋ชจ๋ ์๋ก์ด ์ฝ์
๋ <literal>Customer</literal> ์ธ์คํด์ค๋ค์ session-level ์บ์ ๋ด์ ์บ์์ํค๊ธฐ ๋๋ฌธ์ด๋ค. ์ด ์ฅ์์ ์ฐ๋ฆฌ๋ ์ด ๋ฌธ์ ๋ฅผ ํํผํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค ๊ฒ์ด๋ค."
#. Tag: para
#: batch.xml:45
-#, fuzzy, no-c-format
-msgid ""
-"If you are undertaking batch processing you will need to enable the use of "
-"JDBC batching. This is absolutely essential if you want to achieve optimal "
-"performance. Set the JDBC batch size to a reasonable number (10-50, for "
-"example):"
-msgstr ""
-"์ด ์ฅ์์ ์ฐ๋ฆฌ๋ ์ด ๋ฌธ์ ๋ฅผ ํผํ๋ ๋ฐฉ๋ฒ์ ๋น์ ์๊ฒ ๋ณด์ฌ์ค ๊ฒ์ด๋ค. ํ์ง๋ง ๋จผ์ "
-"๋น์ ์ด ๋ฐฐ์น ์ฒ๋ฆฌ๋ฅผ ํํ๋ ์ค์ด๋ผ๋ฉด, ๋น์ ์ด ์ ๋นํ ํผํฌ๋จผ์ค๋ฅผ ์ฑ์ทจํ๋ ค๊ณ ํ ๊ฒฝ"
-"์ฐ์ ๋น์ ์ด JDBC ๋ฐฐ์น ์ฌ์ฉ์ ๊ฐ๋ฅํ๊ฒ ํ๋ ๊ฒ์ ์ ๋์ ์ผ๋ก ํ์ํ๋ค. JDBC ๋ฐฐ"
-"์น ์ฌ์ด์ฆ๋ฅผ ์ ๋นํ ์ซ์(10-50)๋ก ์ค์ ํ๋ผ:"
+#, no-c-format
+msgid "If you are undertaking batch processing you will need to enable the use of JDBC batching. This is absolutely essential if you want to achieve optimal performance. Set the JDBC batch size to a reasonable number (10-50, for example):"
+msgstr "๋ง์ผ ๋น์ ์ด ๋ฐฐ์น ์ฒ๋ฆฌ๋ฅผ ํํ๋ ์ค์ด๋ผ๋ฉด, ๋น์ ์ JDBC ๋ฐฐ์น ์ฌ์ฉ์ ์ด์ฉ ๊ฐ๋ฅํ๋๋ก ํ ํ์๊ฐ ์์ ๊ฒ์ด๋ค. ๋ง์ผ ๋น์ ์ด ์ต์ ์ ์ฑ๋ฅ์ ์ฑ์ทจํ๊ณ ์ ์ํ๋ค๋ฉด ์ด๊ฒ์ด ์ ๋์ ์ผ๋ก ํ์์ ์ด๋ค. JDBC ๋ฐฐ์น ์ฌ์ด์ฆ๋ฅผ ์ ๋นํ ์ซ์๋ก ์ค์ ํ๋ผ(์๋ฅผ ๋ค๋ฉด,10-50):"
#. Tag: programlisting
#: batch.xml:52
#, no-c-format
msgid "<![CDATA[hibernate.jdbc.batch_size 20]]>"
-msgstr ""
+msgstr "<![CDATA[hibernate.jdbc.batch_size 20]]>"
#. Tag: para
#: batch.xml:54
-#, fuzzy, no-c-format
-msgid ""
-"Hibernate disables insert batching at the JDBC level transparently if you "
-"use an <literal>identity</literal> identifier generator."
-msgstr ""
-"๋ง์ผ ๋น์ ์ด <literal>identiy</literal> ์๋ณ์ ์์ฑ์๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ Hibernate"
-"๊ฐ JDBC ๋ ๋ฒจ์์ ํฌ๋ช
ํ๊ฒ insert ๋ฐฐ์น์์
์ ์ฌ์ฉ๋ถ๊ฐ๋ฅํ๊ฒ ํ๋ค๋ ์ ์ ๋
ธํธํ"
-"๋ผ."
+#, no-c-format
+msgid "Hibernate disables insert batching at the JDBC level transparently if you use an <literal>identity</literal> identifier generator."
+msgstr "๋ง์ผ ๋น์ ์ด <literal>identiy</literal> ์๋ณ์ ์์ฑ์๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ์ ํ์ด๋ฒ๋ค์ดํธ๋ JDBC ๋ ๋ฒจ์์ ํฌ๋ช
ํ๊ฒ insert ๋ฐฐ์น์์
์ ์ฌ์ฉ๋ถ๊ฐ๋ฅํ๋๋ก ๋ง๋ ๋ค."
#. Tag: para
#: batch.xml:59
-#, fuzzy, no-c-format
-msgid ""
-"You can also do this kind of work in a process where interaction with the "
-"second-level cache is completely disabled:"
-msgstr ""
-"๋น์ ์ ๋ํ second-level ์บ์๋ฅผ ๊ฐ์ง ์ํธ์์ฉ์ด ์์ ํ๊ฒ ๋ถ๊ฐ๋ฅํ ํ๋ก์ธ์ค ๋ด"
-"์์ ์ด๋ฐ ์ข
๋ฅ์ ์์
์ ํํ๊ณ ์ถ์ดํ ์๋ ์๋ค:"
+#, no-c-format
+msgid "You can also do this kind of work in a process where interaction with the second-level cache is completely disabled:"
+msgstr "๋น์ ์ ๋ํ second-level ์บ์๋ฅผ ๊ฐ์ง ์ํธ์์ฉ์ด ์ ์ ์ผ๋ก ์ฌ์ฉ๋ถ๊ฐ๋ฅํ ํ๋ก์ธ์ค ๋ด์์ ์ด๋ฐ ์ข
๋ฅ์ ์์
์ ํํ ์ ์๋ค:"
#. Tag: programlisting
#: batch.xml:64
#, no-c-format
msgid "<![CDATA[hibernate.cache.use_second_level_cache false]]>"
-msgstr ""
+msgstr "<![CDATA[hibernate.cache.use_second_level_cache false]]>"
#. Tag: para
#: batch.xml:66
#, no-c-format
-msgid ""
-"However, this is not absolutely necessary, since we can explicitly set the "
-"<literal>CacheMode</literal> to disable interaction with the second-level "
-"cache."
-msgstr ""
-"ํ์ง๋ง ์ด๊ฒ์ ์ ๋์ ์ผ๋ก ํ์ํ์ง ์๋ค. ์๋ํ๋ฉด ์ฐ๋ฆฌ๋ second-level ์บ์์"
-"์ ์ํธ์์ฉ์ ๋ถ๊ฐ๋ฅํ๋๋ก ํ๊ธฐ ์ํด ๋ช
์์ ์ผ๋ก <literal>CacheMode</literal>"
-"๋ฅผ ์ค์ ํ ์ ์๊ธฐ ๋๋ฌธ์ด๋ค."
+msgid "However, this is not absolutely necessary, since we can explicitly set the <literal>CacheMode</literal> to disable interaction with the second-level cache."
+msgstr "ํ์ง๋ง ์ด๊ฒ์ ์ ๋์ ์ผ๋ก ํ์ํ์ง ์๋ค. ์๋ํ๋ฉด ์ฐ๋ฆฌ๋ second-level ์บ์์์ ์ํธ์์ฉ์ ๋ถ๊ฐ๋ฅํ๋๋ก ํ๊ธฐ ์ํด ๋ช
์์ ์ผ๋ก <literal>CacheMode</literal>๋ฅผ ์ค์ ํ ์ ์๊ธฐ ๋๋ฌธ์ด๋ค."
#. Tag: title
#: batch.xml:72
@@ -120,15 +94,9 @@
#. Tag: para
#: batch.xml:74
-#, fuzzy, no-c-format
-msgid ""
-"When making new objects persistent <literal>flush()</literal> and then "
-"<literal>clear()</literal> the session regularly in order to control the "
-"size of the first-level cache."
-msgstr ""
-"์๋ก์ด ๊ฐ์ฒด๋ค์ ์์ํ ์ํฌ ๋, ๋น์ ์ first-level ์บ์์ ์ฌ์ด์ฆ๋ฅผ ์ ์ดํ๊ธฐ "
-"์ํด ์ธ์
์ ์ ๊ธฐ์ ์ผ๋ก <literal>flush()</literal> ์ํค๊ณ ๋์ <literal>clear"
-"()</literal> ์์ผ์ผ ํ๋ค."
+#, no-c-format
+msgid "When making new objects persistent <literal>flush()</literal> and then <literal>clear()</literal> the session regularly in order to control the size of the first-level cache."
+msgstr "์๋ก์ด ๊ฐ์ฒด๋ค์ ์์ํ ์ํฌ ๋ ๋น์ ์ first-level ์บ์์ ์ฌ์ด์ฆ๋ฅผ ์ ์ดํ๊ธฐ ์ํด ์ธ์
์ ์ ๊ธฐ์ ์ผ๋ก <literal>flush()</literal> ์ํค๊ณ ๋์ <literal>clear()</literal> ํ๋ผ."
#. Tag: programlisting
#: batch.xml:80
@@ -150,6 +118,21 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"for ( int i=0; i<100000; i++ ) {\n"
+" Customer customer = new Customer(.....);\n"
+" session.save(customer);\n"
+" if ( i % 20 == 0 ) { //20, same as the JDBC batch size\n"
+" //flush a batch of inserts and release memory:\n"
+" session.flush();\n"
+" session.clear();\n"
+" }\n"
+"}\n"
+" \n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: title
#: batch.xml:85
@@ -159,15 +142,9 @@
#. Tag: para
#: batch.xml:87
-#, fuzzy, no-c-format
-msgid ""
-"For retrieving and updating data, the same ideas apply. In addition, you "
-"need to use <literal>scroll()</literal> to take advantage of server-side "
-"cursors for queries that return many rows of data."
-msgstr ""
-"๋ฐ์ดํฐ ๊ฒ์๊ณผ ์
๋ฐ์ดํธ์ ๊ฒฝ์ฐ ๋์ผํ ๊ฐ๋
๋ค์ด ์ ์ฉ๋๋ค. ๊ฒ๋ค๊ฐ ๋น์ ์ ๋ง์ ๋ฐ"
-"์ดํฐ ํ๋ค์ ๋ฐํํ๋ ์ง์๋ค์ ๋ํด ์๋ฒ-์ธก ์ปค์๋ค์ ์ฅ์ ์ ์ทจํ๋๋ฐ "
-"<literal>scroll()</literal>์ ์ฌ์ฉํ ํ์๊ฐ ์๋ค."
+#, no-c-format
+msgid "For retrieving and updating data, the same ideas apply. In addition, you need to use <literal>scroll()</literal> to take advantage of server-side cursors for queries that return many rows of data."
+msgstr "๋ฐ์ดํฐ ๊ฒ์ํ๊ณ ์
๋ฐ์ดํธํ ๋, ๋์ผํ ๊ฐ๋
๋ค์ด ์ ์ฉ๋๋ค. ๊ฒ๋ค๊ฐ ๋น์ ์ ๋ง์ ๋ฐ์ดํฐ ํ๋ค์ ๋ฐํํ๋ ์ง์๋ค์ ์ํ ์๋ฒ-์ธก ์ปค์๋ค์ ์ฅ์ ์ ์ทจํํ๊ธฐ ์ํด <literal>scroll()</literal>์ ์ฌ์ฉํ ํ์๊ฐ ์๋ค."
#. Tag: programlisting
#: batch.xml:93
@@ -193,6 +170,25 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n"
+" .setCacheMode(CacheMode.IGNORE)\n"
+" .scroll(ScrollMode.FORWARD_ONLY);\n"
+"int count=0;\n"
+"while ( customers.next() ) {\n"
+" Customer customer = (Customer) customers.get(0);\n"
+" customer.updateStuff(...);\n"
+" if ( ++count % 20 == 0 ) {\n"
+" //flush a batch of updates and release memory:\n"
+" session.flush();\n"
+" session.clear();\n"
+" }\n"
+"}\n"
+" \n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: title
#: batch.xml:98
@@ -202,35 +198,9 @@
#. Tag: para
#: batch.xml:99
-#, fuzzy, no-c-format
-msgid ""
-"Alternatively, Hibernate provides a command-oriented API that can be used "
-"for streaming data to and from the database in the form of detached objects. "
-"A <literal>StatelessSession</literal> has no persistence context associated "
-"with it and does not provide many of the higher-level life cycle semantics. "
-"In particular, a stateless session does not implement a first-level cache "
-"nor interact with any second-level or query cache. It does not implement "
-"transactional write-behind or automatic dirty checking. Operations performed "
-"using a stateless session never cascade to associated instances. Collections "
-"are ignored by a stateless session. Operations performed via a stateless "
-"session bypass Hibernate's event model and interceptors. Due to the lack of "
-"a first-level cache, Stateless sessions are vulnerable to data aliasing "
-"effects. A stateless session is a lower-level abstraction that is much "
-"closer to the underlying JDBC."
-msgstr ""
-"๋ค๋ฅธ ๋ฐฉ๋ฒ์ผ๋ก Hibernate๋ ๋ถ๋ฆฌ๋(detached) ๊ฐ์ฒด๋ค์ ํ์์ผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก "
-"๊ทธ๋ฆฌ๊ณ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก๋ถํฐ ๋ฐ์ดํฐ๋ฅผ ์คํธ๋ฆฌ๋ฐํ๋๋ฐ ์ฌ์ฉ๋ ์ ์๋ ํ๋์ ๋ช
๋ น "
-"์งํฅ API๋ฅผ ์ ๊ณตํ๋ค. <literal>StatelessSession</literal>์ ๊ทธ๊ฒ๊ณผ ์ฐ๊ด๋ ์"
-"์ ์ปจํ
์คํธ๋ฅผ ๊ฐ์ง ์๊ณ ๋ง์ ๋ณด๋ค ๋์ ๋ ๋ฒจ์ ์๋ช
์ฃผ๊ธฐ ์๋ฏธ๋ฅผ ์ ๊ณตํ์ง ์๋"
-"๋ค. ํนํ ํ๋์ ์ํ ์๋ ์ธ์
์ ์ฒซ ๋ฒ์งธ ๋ ๋ฒจ ์บ์๋ฅผ ๊ตฌํํ์ง ์๊ฑฐ๋ ์์์ "
-"๋ ๋ฒ์งธ ๋ ๋ฒจ ์บ์ ๋๋ ์ง์ ์บ์์ ์ํธ์์ฉํ์ง ์๋๋ค. ๊ทธ๊ฒ์ ์ ํต์ ์ธ ์ฐ๊ธฐ-"
-"์ด๋ฉด(write-behind)์ ์ฒดํน์ด๋ ์๋์ ์ธ dirty ์ฒดํน์ ๊ตฌํํ์ง ์๋๋ค. ํ๋์ "
-"์ํ ์๋ ์ธ์
์ ์ฌ์ฉํ์ฌ ์ํ๋ ์ฐ์ฐ๋ค์ ์ฐ๊ด๋ ์ธ์คํด์ค๋ค์ ๋ํด ์ผ์ค์ผ์ด"
-"๋ ๋์ง ์๋๋ค. ์ฝ๋ ์
๋ค์ ์ํ ์๋ ์ธ์
์ ์ํด ๋ฌด์๋๋ค. ์ํ์๋ ์ธ์
์ ํต"
-"ํด ์ํ๋ ์ฐ์ฐ๋ค์ Hibernate์ ์ด๋ฒคํธ ๋ชจํ๊ณผ ์ธํฐ์
ํฐ๋ค์ ์ฐํํ๋ค. ์ํ์๋ "
-"์ธ์
๋ค์ ์ฒซ๋ฒ์งธ-๋ ๋ฒจ์ ์บ์์ ๋ถ์กฑ์ผ๋ก ์ธํด ๋ฐ์ดํฐ alias ํจ๊ณผ๋ค์ ์ทจ์ฝํ๋ค. "
-"์ํ์๋ ์ธ์
์ ๊ธฐ๋ณธ JDBC์ ํจ์ฌ ๋ ๊ฐ๊น์ด ํ๋์ ๋ณด๋ค ๋ฎ์ ๋ ๋ฒจ์ ์ถ์ํ"
-"(abstraction)์ด๋ค."
+#, no-c-format
+msgid "Alternatively, Hibernate provides a command-oriented API that can be used for streaming data to and from the database in the form of detached objects. A <literal>StatelessSession</literal> has no persistence context associated with it and does not provide many of the higher-level life cycle semantics. In particular, a stateless session does not implement a first-level cache nor interact with any second-level or query cache. It does not implement transactional write-behind or automatic dirty checking. Operations performed using a stateless session never cascade to associated instances. Collections are ignored by a stateless session. Operations performed via a stateless session bypass Hibernate's event model and interceptors. Due to the lack of a first-level cache, Stateless sessions are vulnerable to data aliasing effects. A stateless session is a lower-level abstraction that is much closer to the underlying JDBC."
+msgstr "๋ค๋ฅธ ๋ฐฉ๋ฒ์ผ๋ก ํ์ด๋ฒ๋ค์ดํธ๋ ๋ถ๋ฆฌ๋(detached) ๊ฐ์ฒด๋ค์ ํ์์ผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก ๊ทธ๋ฆฌ๊ณ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก๋ถํฐ ๋ฐ์ดํฐ๋ฅผ ์คํธ๋ฆฌ๋ฐํ๋๋ฐ ์ฌ์ฉ๋ ์ ์๋ ๋ช
๋ น-์งํฅ API๋ฅผ ์ ๊ณตํ๋ค. <literal>StatelessSession</literal>์ ๊ทธ๊ฒ๊ณผ ์ฐ๊ด๋ ์์ ์ปจํ
์คํธ๋ฅผ ๊ฐ์ง ์๊ณ ๋ง์ ๋ณด๋ค ๋์ ๋ ๋ฒจ์ ์๋ช
์ฃผ๊ธฐ ์๋ฏธ๋ฅผ ์ ๊ณตํ์ง ์๋๋ค. ํนํ ํ๋์ ์ํ ์๋ ์ธ์
์ ์ฒซ ๋ฒ์งธ ๋ ๋ฒจ ์บ์๋ฅผ ๊ตฌํํ์ง ์์ผ๋ฉฐ ์์์ ๋ ๋ฒ์งธ ๋ ๋ฒจ ์บ์ ๋๋ ์ง์ ์บ์์ ์ํธ์์ฉํ์ง ์๋๋ค. ๊ทธ๊ฒ์ ํธ๋์ญ์
์์ ์ฐ๊ธฐ-์ด๋ฉด(write-behind)์ ์ฒดํน์ด๋ ์๋์ ์ธ dirty ์ฒดํน์ ๊ตฌํํ์ง ์๋๋ค. ์ํ ์๋ ์ธ์
์ ์ฌ์ฉํ์ฌ ์ํ๋ ์ฐ์ฐ๋ค์ ๊ฒฐ์ฝ ์ฐ๊ด๋ ์ธ์คํด์ค๋ค์ ๋ํด ์ผ์ค์ผ์ด๋ ๋์ง ์๋๋ค. ์ฝ๋ ์
๋ค์ ์ํ ์๋ ์ธ์
์ ์ํด ๋ฌด์๋๋ค. ์ํ์๋ ์ธ์
์ ํตํด ์ํ๋ ์ฐ์ฐ๋ค์ ํ์ด๏ฟฝ!
๏ฟฝ๏ฟฝ๋ค์ดํธ์ ์ด๋ฒคํธ ๋ชจํ๊ณผ ์ธํฐ์
ํฐ๋ค์ ์ฐํํ๋ค. ์ฒซ๋ฒ์งธ-๋ ๋ฒจ์ ์บ์์ ๋ถ์ฌ์ผ๋ก ์ธํด, ์ํ์๋ ์ธ์
๋ค์ ๋ฐ์ดํฐ alias ํจ๊ณผ๋ค์ ์ทจ์ฝํ๋ค. ์ํ์๋ ์ธ์
์ ๊ธฐ๋ฐ JDBC์ ํจ์ฌ ๋ ๊ฐ๊น์ด ํ๋์ ๋ณด๋ค ๋ฎ์ ๋ ๋ฒจ์ ์ถ์์ด๋ค."
#. Tag: programlisting
#: batch.xml:114
@@ -250,38 +220,31 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[StatelessSession session = sessionFactory.openStatelessSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n"
+" .scroll(ScrollMode.FORWARD_ONLY);\n"
+"while ( customers.next() ) {\n"
+" Customer customer = (Customer) customers.get(0);\n"
+" customer.updateStuff(...);\n"
+" session.update(customer);\n"
+"}\n"
+" \n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: para
#: batch.xml:116
-#, fuzzy, no-c-format
-msgid ""
-"In this code example, the <literal>Customer</literal> instances returned by "
-"the query are immediately detached. They are never associated with any "
-"persistence context."
-msgstr ""
-"์ด ์ฝ๋ ์์ ์์, ์ง์์ ์ํด ๋ฐํ๋ <literal>Customer</literal> ์ธ์คํด์ค๋ค"
-"์ ๊ณง๋ฐ๊ณ ๋ถ๋ฆฌ๋๋ค(detached). ๊ทธ๊ฒ๋ค์ ์์์ ์์ ์ปจํ
์คํธ์ ๊ฒฐ์ฝ ์ฐ๊ด๋์ง "
-"์๋๋ค."
+#, no-c-format
+msgid "In this code example, the <literal>Customer</literal> instances returned by the query are immediately detached. They are never associated with any persistence context."
+msgstr "์ด ์ฝ๋ ์์ ์์, ์ง์์ ์ํด ๋ฐํ๋ <literal>Customer</literal> ์ธ์คํด์ค๋ค์ ๊ณง๋ฐ๊ณ ๋ถ๋ฆฌ๋๋ค(detached). ๊ทธ๊ฒ๋ค์ ์์์ ์์ ์ปจํ
์คํธ์ ๊ฒฐ์ฝ ์ฐ๊ด๋์ง ์๋๋ค."
#. Tag: para
#: batch.xml:122
-#, fuzzy, no-c-format
-msgid ""
-"The <literal>insert(), update()</literal> and <literal>delete()</literal> "
-"operations defined by the <literal>StatelessSession</literal> interface are "
-"considered to be direct database row-level operations. They result in the "
-"immediate execution of a SQL <literal>INSERT, UPDATE</literal> or "
-"<literal>DELETE</literal> respectively. They have different semantics to the "
-"<literal>save(), saveOrUpdate()</literal> and <literal>delete()</literal> "
-"operations defined by the <literal>Session</literal> interface."
-msgstr ""
-"<literal>StatelessSession</literal> ์ธํฐํ์ด์ค์ ์ํด ์ ์๋ <literal>insert"
-"(), update()</literal> ๊ทธ๋ฆฌ๊ณ <literal>delete()</literal> ์ฐ์ฐ๋ค์ ์ง์ ์ ์ธ "
-"๋ฐ์ดํฐ๋ฒ ์ด์ค ์ ๊ธ ์ฐ์ฐ๋ค๋ก ๊ฐ์ฃผ๋๊ณ , ๊ทธ๊ฒ์ ๊ฐ๊ฐ ํ๋์ SQL <literal>INSERT, "
-"UPDATE</literal> ๋๋ <literal>DELETE</literal>์ ์ฆ๊ฐ์ ์ธ ์คํ์ผ๋ก ๊ท๊ฒฐ๋"
-"๋ค. ๋ฐ๋ผ์ ๊ทธ๊ฒ๋ค์ <literal>Session</literal> ์ธํฐํ์ด์ค์ ์ํด ์ ์๋ "
-"<literal>save(), saveOrUpdate()</literal>์ <literal>delete()</literal> ์ฐ์ฐ"
-"๋ค๊ณผ๋ ๋งค์ฐ ๋ค๋ฅธ ์๋ฏธ๋ค์ ๊ฐ๋๋ค."
+#, no-c-format
+msgid "The <literal>insert(), update()</literal> and <literal>delete()</literal> operations defined by the <literal>StatelessSession</literal> interface are considered to be direct database row-level operations. They result in the immediate execution of a SQL <literal>INSERT, UPDATE</literal> or <literal>DELETE</literal> respectively. They have different semantics to the <literal>save(), saveOrUpdate()</literal> and <literal>delete()</literal> operations defined by the <literal>Session</literal> interface."
+msgstr "<literal>StatelessSession</literal> ์ธํฐํ์ด์ค์ ์ํด ์ ์๋ <literal>insert(), update()</literal> ๊ทธ๋ฆฌ๊ณ <literal>delete()</literal> ์ฐ์ฐ๋ค์ ์ง์ ์ ์ธ ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ ๋ ๋ฒจ์ ์ฐ์ฐ๋ค๋ก ๊ฐ์ฃผ๋๋ค. ๊ทธ๊ฒ๋ค์ ๊ฐ๊ฐ ํ๋์ SQL <literal>INSERT, UPDATE</literal> ๋๋ <literal>DELETE</literal>์ ์ฆ๊ฐ์ ์ธ ์คํ์ผ๋ก ๊ท๊ฒฐ๋๋ค. ๊ทธ๊ฒ๋ค์ <literal>Session</literal> ์ธํฐํ์ด์ค์ ์ํด ์ ์๋ <literal>save(), saveOrUpdate()</literal>์ <literal>delete()</literal> ์ฐ์ฐ๋ค๊ณผ๋ ๋ค๋ฅธ ์๋ฏธ๋ค์ ๊ฐ๋๋ค."
#. Tag: title
#: batch.xml:135
@@ -291,44 +254,21 @@
#. Tag: para
#: batch.xml:137
-#, fuzzy, no-c-format
-msgid ""
-"As already discussed, automatic and transparent object/relational mapping is "
-"concerned with the management of the object state. The object state is "
-"available in memory. This means that manipulating data directly in the "
-"database (using the SQL <literal>Data Manipulation Language</literal> (DML) "
-"the statements: <literal>INSERT</literal>, <literal>UPDATE</literal>, "
-"<literal>DELETE</literal>) will not affect in-memory state. However, "
-"Hibernate provides methods for bulk SQL-style DML statement execution that "
-"is performed through the Hibernate Query Language (<link linkend=\"queryhql"
-"\">HQL</link>)."
-msgstr ""
-"์ด๋ฏธ ๋
ผ์ํ๋ฏ์ด, ์๋์ ์ด๊ณ ํฌ๋ช
ํ ๊ฐ์ฒด/๊ด๊ณํ ๋งคํ์ ๊ฐ์ฒด ์ํ์ ๋ํ ๊ด๋ฆฌ"
-"์ ๊ด๊ณ๋๋ค. ์ด๊ฒ์ ๊ฐ์ฒด ์ํ๊ฐ ๋ฉ๋ชจ๋ฆฌ ๋ด์์ ์ด์ฉ ๊ฐ๋ฅํจ์ ์๋ฏธํ๋ฏ๋ก, (SQL "
-"<literal>Data Manipulation Language</literal>(DML) ๋ฌธ์ฅ๋ค : <literal>INSERT</"
-"literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>๋ฅผ ์ฌ์ฉํ์ฌ) ๋ฐ"
-"์ดํฐ๋ฒ ์ด์ค์์ ์ง์ ๋ฐ์ดํฐ๋ฅผ ์
๋ฐ์ดํธํ๊ฑฐ๋ ์ญ์ ํ๋ ๊ฒ์ ๋ฉ๋ชจ๋ฆฌ ๋ด ์ํ์ ์"
-"ํฅ์ ์ฃผ์ง ์์ ๊ฒ์ด๋ค. ํ์ง๋ง Hibernate๋ Hibernate Query Language (<xref "
-"linkend=\"queryhql\">HQL</xref>)๋ฅผ ํตํด ์คํ๋๋ ๋๋ SQL-์คํ์ผ์ DML ๋ฌธ์ฅ "
-"์คํ์ ์ํ ๋ฉ์๋๋ค์ ์ ๊ณตํ๋ค."
+#, no-c-format
+msgid "As already discussed, automatic and transparent object/relational mapping is concerned with the management of the object state. The object state is available in memory. This means that manipulating data directly in the database (using the SQL <literal>Data Manipulation Language</literal> (DML) the statements: <literal>INSERT</literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>) will not affect in-memory state. However, Hibernate provides methods for bulk SQL-style DML statement execution that is performed through the Hibernate Query Language (<link linkend=\"queryhql\">HQL</link>)."
+msgstr "์ด๋ฏธ ๋
ผ์ํ๋ฏ์ด, ์๋์ ์ด๊ณ ํฌ๋ช
ํ ๊ฐ์ฒด/๊ด๊ณํ ๋งคํ์ ๊ฐ์ฒด ์ํ์ ๋ํ ๊ด๋ฆฌ์ ๊ด๊ณ๋๋ค. ๊ฐ์ฒด์ ์ํ๋ ๋ฉ๋ชจ๋ฆฌ ๋ด์์ ์ด์ฉ ๊ฐ๋ฅํ๋ค. (SQL <literal>๋ฐ์ดํฐ ์ฒ๋ฆฌ ์ธ์ด</literal>(DML) ๋ฌธ์ฅ๋ค : <literal>INSERT</literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>๋ฅผ ์ฌ์ฉํ์ฌ) ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ์ง์ ๋ฐ์ดํฐ ์ฒ๋ฆฌํ๋ ๊ฒ์ด ๋ฉ๋ชจ๋ฆฌ ๋ด ์ํ์ ์ํฅ์ ์ฃผ์ง ์์์ ์๋ฏธํ๋ค. ํ์ง๋ง ํ์ด๋ฒ๋ค์ดํธ๋ ํ์ด๋ฒ๋ค์ดํธ ์ง์ ์ธ์ด(<xref linkend=\"queryhql\">HQL</xref>)๋ฅผ ํตํด ์คํ๋๋ ๋๋ SQL-์คํ์ผ์ DML ๋ฌธ์ฅ ์คํ์ ์ํ ๋ฉ์๋๋ค์ ์ ๊ณตํ๋ค."
#. Tag: para
#: batch.xml:146
-#, fuzzy, no-c-format
-msgid ""
-"The pseudo-syntax for <literal>UPDATE</literal> and <literal>DELETE</"
-"literal> statements is: <literal>( UPDATE | DELETE ) FROM? EntityName (WHERE "
-"where_conditions)?</literal>."
-msgstr ""
-"<literal>UPDATE</literal>์ <literal>DELETE</literal> ๋ฌธ์ฅ๋ค์ ๋ํ ์ ์ฌ ๊ตฌ๋ฌธ"
-"์ ๋ค์๊ณผ ๊ฐ๋ค: <literal>( UPDATE | DELETE ) FROM? EntityName (WHERE "
-"where_conditions)?</literal>. ๋
ธํธํ ๋ช ๊ฐ์ง:"
+#, no-c-format
+msgid "The pseudo-syntax for <literal>UPDATE</literal> and <literal>DELETE</literal> statements is: <literal>( UPDATE | DELETE ) FROM? EntityName (WHERE where_conditions)?</literal>."
+msgstr "<literal>UPDATE</literal>์ <literal>DELETE</literal> ๋ฌธ์ฅ๋ค์ ๋ํ ์ ์ฌ ๊ตฌ๋ฌธ์ ๋ค์๊ณผ ๊ฐ๋ค: <literal>( UPDATE | DELETE ) FROM? EntityName (WHERE where_conditions)?</literal>."
#. Tag: para
#: batch.xml:151
#, no-c-format
msgid "Some points to note:"
-msgstr ""
+msgstr "๋
ธํธํ ๋ช ๊ฐ์ง:"
#. Tag: para
#: batch.xml:157
@@ -338,29 +278,15 @@
#. Tag: para
#: batch.xml:162
-#, fuzzy, no-c-format
-msgid ""
-"There can only be a single entity named in the from-clause. It can, however, "
-"be aliased. If the entity name is aliased, then any property references must "
-"be qualified using that alias. If the entity name is not aliased, then it is "
-"illegal for any property references to be qualified."
-msgstr ""
-"from-์ ๋ด์ ํ ๊ฐ์ ๋ช
๋ช
๋ ์ํฐํฐ๊ฐ ์ค์ง ์กด์ฌํ ์ ์๋ค; ๊ทธ๊ฒ์ ์ ํ์ ์ผ๋ก "
-"alias๋ ์ ์๋ค. ๋ง์ผ ์ํฐํฐ ์ด๋ฆ์ด alias๋๋ฉด, ๊ทธ๋ ์์์ ํ๋กํผํฐ ์ฐธ์กฐ๋ค์ "
-"๊ทธ alias๋ฅผ ์ฌ์ฉํ์ฌ ์์๋์ด์ผ ํ๋ค; ๋ง์ผ ์ํฐํฐ ์ด๋ฆ์ด alias๋์ง ์์ ๊ฒฝ์ฐ, "
-"์์์ ํ๋กํผํฐ ์ฐธ์กฐ๋ค์ ๋ํด ์์๋๋ ๊ฒ์ ๊ท์น์ ์ด๊ธ๋๋ค."
+#, no-c-format
+msgid "There can only be a single entity named in the from-clause. It can, however, be aliased. If the entity name is aliased, then any property references must be qualified using that alias. If the entity name is not aliased, then it is illegal for any property references to be qualified."
+msgstr "from-์ ๋ด์ ๋จ์ง ๋ช
๋ช
๋ ํ ๊ฐ์ ์ํฐํฐ๊ฐ ์กด์ฌํ ์ ์๋ค. ํ์ง๋ง ๊ทธ๊ฒ์ ์ ํ์ ์ผ๋ก alias๋ ์ ์๋ค. ๋ง์ผ ์ํฐํฐ ์ด๋ฆ์ด alias๋๋ฉด, ๊ทธ๋ ์์์ ํ๋กํผํฐ ์ฐธ์กฐ๋ค์ ๊ทธ alias๋ฅผ ์ฌ์ฉํ์ฌ ์์๋์ด์ผ ํ๋ค; ๋ง์ผ ์ํฐํฐ ์ด๋ฆ์ด alias๋์ง ์์ ๊ฒฝ์ฐ, ์์์ ํ๋กํผํฐ ์ฐธ์กฐ๋ค์ด ์์๋๋ ๊ฒ์ ๊ท์น์ ์ด๊ธ๋๋ค."
#. Tag: para
#: batch.xml:170
-#, fuzzy, no-c-format
-msgid ""
-"No <link linkend=\"queryhql-joins-forms\">joins</link>, either implicit or "
-"explicit, can be specified in a bulk HQL query. Sub-queries can be used in "
-"the where-clause, where the subqueries themselves may contain joins."
-msgstr ""
-"<xref linkend=\"queryhql-joins-forms\">join๋ค</xref>์ (ํจ์ถ์ ์ด๋ ๋ช
์์ ์ด"
-"๋ ) ๋๋ HQL ์ง์ ์์ ์ง์ ๋ ์ ์๋ค. ์๋ธ-์ง์๋ค์ด where-์ ์ ์ฌ์ฉ๋ ์ ์"
-"๋ค; ์๋ธ์ง์๋ค ๊ทธ ์์ ๋ค์ ์กฐ์ธ๋ค์ ํฌํจํ ์ ์๋ค."
+#, no-c-format
+msgid "No <link linkend=\"queryhql-joins-forms\">joins</link>, either implicit or explicit, can be specified in a bulk HQL query. Sub-queries can be used in the where-clause, where the subqueries themselves may contain joins."
+msgstr "ํจ์ถ์ ์ด๋ ๋ช
์์ ์ด๋ <xref linkend=\"queryhql-joins-forms\">join๋ค</xref>์ ๋๋ HQL ์ง์ ์์ ์ง์ ๋ ์ ์๋ค. ์๋ธ-์ง์๋ค์ด where-์ ์ ์ฌ์ฉ๋ ์ ์๋๋ฐ, ์ฌ๊ธฐ์ ์๋ธ์ง์๋ค ๊ทธ ์์ ๋ค์ ์กฐ์ธ๋ค์ ํฌํจํ ์ ์๋ค."
#. Tag: para
#: batch.xml:177
@@ -370,17 +296,9 @@
#. Tag: para
#: batch.xml:183
-#, fuzzy, no-c-format
-msgid ""
-"As an example, to execute an HQL <literal>UPDATE</literal>, use the "
-"<literal>Query.executeUpdate()</literal> method. The method is named for "
-"those familiar with JDBC's <literal>PreparedStatement.executeUpdate()</"
-"literal>:"
-msgstr ""
-"ํ๋์ ์์ ๋ก์, ํ ๊ฐ์ HQL <literal>UPDATE</literal>๋ฅผ ์คํํ๊ธฐ ์ํด, "
-"<literal>Query.executeUpdate()</literal> ๋ฉ์๋(์ด ๋ฉ์๋๋ JDBC์ "
-"<literal>PreparedStatement.executeUpdate()</literal>์ ์ ์ฌํ๊ฒ ๋ช
๋ช
๋๋ค)๋ฅผ "
-"์ฌ์ฉํ๋ผ:"
+#, no-c-format
+msgid "As an example, to execute an HQL <literal>UPDATE</literal>, use the <literal>Query.executeUpdate()</literal> method. The method is named for those familiar with JDBC's <literal>PreparedStatement.executeUpdate()</literal>:"
+msgstr "ํ๋์ ์์ ๋ก์, ํ ๊ฐ์ HQL <literal>UPDATE</literal>๋ฅผ ์คํํ๊ธฐ ์ํด, <literal>Query.executeUpdate()</literal> ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ผ. ๊ทธ ๋ฉ์๋๋ JDBC์ <literal>PreparedStatement.executeUpdate()</literal>์ ์ ์ฌํ๊ฒ ๋ช
๋ช
๋๋ค:"
#. Tag: programlisting
#: batch.xml:189
@@ -389,10 +307,8 @@
"<![CDATA[Session session = sessionFactory.openSession();\n"
"Transaction tx = session.beginTransaction();\n"
"\n"
-"String hqlUpdate = \"update Customer c set c.name = :newName where c.name = :"
-"oldName\";\n"
-"// or String hqlUpdate = \"update Customer set name = :newName where name = :"
-"oldName\";\n"
+"String hqlUpdate = \"update Customer c set c.name = :newName where c.name = :oldName\";\n"
+"// or String hqlUpdate = \"update Customer set name = :newName where name = :oldName\";\n"
"int updatedEntities = s.createQuery( hqlUpdate )\n"
" .setString( \"newName\", newName )\n"
" .setString( \"oldName\", oldName )\n"
@@ -400,29 +316,23 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"String hqlUpdate = \"update Customer c set c.name = :newName where c.name = :oldName\";\n"
+"// or String hqlUpdate = \"update Customer set name = :newName where name = :oldName\";\n"
+"int updatedEntities = s.createQuery( hqlUpdate )\n"
+" .setString( \"newName\", newName )\n"
+" .setString( \"oldName\", oldName )\n"
+" .executeUpdate();\n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: para
#: batch.xml:191
-#, fuzzy, no-c-format
-msgid ""
-"In keeping with the EJB3 specification, HQL <literal>UPDATE</literal> "
-"statements, by default, do not effect the <link linkend=\"mapping-"
-"declaration-version\">version</link> or the <link linkend=\"mapping-"
-"declaration-timestamp\">timestamp</link> property values for the affected "
-"entities. However, you can force Hibernate to reset the <literal>version</"
-"literal> or <literal>timestamp</literal> property values through the use of "
-"a <literal>versioned update</literal>. This is achieved by adding the "
-"<literal>VERSIONED</literal> keyword after the <literal>UPDATE</literal> "
-"keyword."
-msgstr ""
-"HQL <literal>UPDATE</literal> ๋ฌธ์ฅ๋ค์ ๋ํดํธ๋ก ์ํฅ๋ฐ๋ ์ํฐํฐ๋ค์ ๋ํ "
-"<xref linkend=\"mapping-declaration-version\">version</xref> ๋๋ <xref "
-"linkend=\"mapping-declaration-timestamp\">timestamp</xref> ํ๋กํผํฐ ๊ฐ๋ค์ ์"
-"ํฅ์ ์ฃผ์ง ์๋๋ค; ์ด๊ฒ์ EJB3 ๋ช
์ธ์์์ ์ ์ง๋๊ณ ์๋ค. ํ์ง๋ง ๋น์ ์ ํ์ด๋ฒ"
-"๋ค์ดํธ๋ก ํ์ฌ๊ธ <literal>versioned update</literal>์ ์ฌ์ฉ์ ํตํด "
-"<literal>version</literal> ๋๋ <literal>timestamp</literal> ํ๋กํผํฐ ๊ฐ๋ค์ "
-"์ ์ ํ๊ฒ ์ฌ์ค์ ํ๋๋ก ๊ฐ์ ํ ์ ์๋ค. ์ด๊ฒ์ <literal>UPDATE</literal> ํค์"
-"๋ ๋ค์ <literal>VERSIONED</literal> ํค์๋๋ฅผ ์ถ๊ฐ์์ผ์ ์ฑ์ทจ๋๋ค."
+#, no-c-format
+msgid "In keeping with the EJB3 specification, HQL <literal>UPDATE</literal> statements, by default, do not effect the <link linkend=\"mapping-declaration-version\">version</link> or the <link linkend=\"mapping-declaration-timestamp\">timestamp</link> property values for the affected entities. However, you can force Hibernate to reset the <literal>version</literal> or <literal>timestamp</literal> property values through the use of a <literal>versioned update</literal>. This is achieved by adding the <literal>VERSIONED</literal> keyword after the <literal>UPDATE</literal> keyword."
+msgstr "์ด๊ฒ์ EJB3 ๋ช
์ธ์์์ ์ ์ง๋๊ณ ์๋ฏ์ด, HQL <literal>UPDATE</literal> ๋ฌธ์ฅ๋ค์ ๋ํดํธ๋ก ์ํฅ๋ฐ๋ ์ํฐํฐ๋ค์ ๋ํ <xref linkend=\"mapping-declaration-version\">version</xref> ๋๋ <xref linkend=\"mapping-declaration-timestamp\">timestamp</xref> ํ๋กํผํฐ ๊ฐ๋ค์ ์ํฅ์ ์ฃผ์ง ์๋๋ค. ํ์ง๋ง ๋น์ ์ ํ์ด๋ฒ๋ค์ดํธ๋ก ํ์ฌ๊ธ <literal>versioned update</literal>์ ์ฌ์ฉ์ ํตํด <literal>version</literal> ๋๋ <literal>timestamp</literal> ํ๋กํผํฐ ๊ฐ๋ค์ ์ ์ ํ๊ฒ ์ฌ์ค์ ํ๋๋ก ๊ฐ์ ์ํฌ ์ ์๋ค. ์ด๊ฒ์ <literal>UPDATE</literal> ํค์๋ ๋ค์ <literal>VERSIONED</literal> ํค์๋๋ฅผ ์ถ๊ฐ์ํด์ผ๋ก์จ ๋ฌ์ฑ๋๋ค."
#. Tag: programlisting
#: batch.xml:201
@@ -430,8 +340,7 @@
msgid ""
"<![CDATA[Session session = sessionFactory.openSession();\n"
"Transaction tx = session.beginTransaction();\n"
-"String hqlVersionedUpdate = \"update versioned Customer set name = :newName "
-"where name = :oldName\";\n"
+"String hqlVersionedUpdate = \"update versioned Customer set name = :newName where name = :oldName\";\n"
"int updatedEntities = s.createQuery( hqlUpdate )\n"
" .setString( \"newName\", newName )\n"
" .setString( \"oldName\", oldName )\n"
@@ -439,28 +348,27 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"String hqlVersionedUpdate = \"update versioned Customer set name = :newName where name = :oldName\";\n"
+"int updatedEntities = s.createQuery( hqlUpdate )\n"
+" .setString( \"newName\", newName )\n"
+" .setString( \"oldName\", oldName )\n"
+" .executeUpdate();\n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: para
#: batch.xml:203
-#, fuzzy, no-c-format
-msgid ""
-"Custom version types, <literal>org.hibernate.usertype.UserVersionType</"
-"literal>, are not allowed in conjunction with a <literal>update versioned</"
-"literal> statement."
-msgstr ""
-"๋ง์ถคํ version ํ์
๋ค(<literal>org.hibernate.usertype.UserVersionType</"
-"literal>)์ <literal>update versioned</literal> ๋ฌธ์ฅ๊ณผ ํจ๊ป ์ฌ์ฉํ๋ ๊ฒ์ด ํ"
-"์ฉ๋์ง ์์์ ๋
ธํธํ๋ผ."
+#, no-c-format
+msgid "Custom version types, <literal>org.hibernate.usertype.UserVersionType</literal>, are not allowed in conjunction with a <literal>update versioned</literal> statement."
+msgstr "๋ง์ถคํ version ํ์
๋ค, <literal>org.hibernate.usertype.UserVersionType</literal>์ <literal>update versioned</literal>๊ณผ ๋ฌธ์ฅ๊ณผ ํจ๊ป ์ฌ์ฉํ๋ ๊ฒ์ด ํ์ฉ๋์ง ์๋๋ค."
#. Tag: para
#: batch.xml:208
#, no-c-format
-msgid ""
-"To execute an HQL <literal>DELETE</literal>, use the same <literal>Query."
-"executeUpdate()</literal> method:"
-msgstr ""
-"HQL <literal>DELETE</literal>๋ฅผ ์คํํ๋ ค๋ฉด, ๊ฐ์ ๋ฉ์๋ <literal>Query."
-"executeUpdate()</literal>๋ฅผ ์ฌ์ฉํ๋ผ:"
+msgid "To execute an HQL <literal>DELETE</literal>, use the same <literal>Query.executeUpdate()</literal> method:"
+msgstr "HQL <literal>DELETE</literal>๋ฅผ ์คํํ๋ ค๋ฉด, ๊ฐ์ ๋ฉ์๋ <literal>Query.executeUpdate()</literal>๋ฅผ ์ฌ์ฉํ๋ผ:"
#. Tag: programlisting
#: batch.xml:213
@@ -477,155 +385,64 @@
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"String hqlDelete = \"delete Customer c where c.name = :oldName\";\n"
+"// or String hqlDelete = \"delete Customer where name = :oldName\";\n"
+"int deletedEntities = s.createQuery( hqlDelete )\n"
+" .setString( \"oldName\", oldName )\n"
+" .executeUpdate();\n"
+"tx.commit();\n"
+"session.close();]]>"
#. Tag: para
#: batch.xml:215
-#, fuzzy, no-c-format
-msgid ""
-"The <literal>int</literal> value returned by the <literal>Query.executeUpdate"
-"()</literal> method indicates the number of entities effected by the "
-"operation. This may or may not correlate to the number of rows effected in "
-"the database. An HQL bulk operation might result in multiple actual SQL "
-"statements being executed (for joined-subclass, for example). The returned "
-"number indicates the number of actual entities affected by the statement. "
-"Going back to the example of joined-subclass, a delete against one of the "
-"subclasses may actually result in deletes against not just the table to "
-"which that subclass is mapped, but also the \"root\" table and potentially "
-"joined-subclass tables further down the inheritance hierarchy."
-msgstr ""
-"<literal>Query.executeUpdate()</literal> ๋ฉ์๋์ ์ํด ๋ฐํ๋๋ "
-"<literal>int</literal> ๊ฐ์ ๊ทธ ์คํผ๋ ์ด์
์ ์ํด ์ํฅ๋ฐ์ ์ํฐํฐ๋ค์ ๊ฐ์๋ฅผ "
-"๋ํ๋ธ๋ค. ์ด๊ฒ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด์์ ์ํฅ๋ฐ์ ํ๋ค์ ๊ฐ์์ ์๊ด์ด ์๋์ง ์"
-"๋์ง ์ฌ๋ถ๋ฅผ ์ดํด๋ณด์. HQL ๋๋ ์คํผ๋ ์ด์
์ ์๋ฅผ ๋ค์ด joined-subclass์ ๊ฒฝ์ฐ"
-"์ ์คํ ์ค์ธ ์ฌ๋ฌ ๊ฐ์ ์ค์ SQL ๋ฌธ์ฅ๋ค๋ก ๊ท๊ฒฐ๋ ์ ์๋ค. ๋ฐํ๋๋ ์ซ์๋ ๊ทธ "
-"๋ฌธ์ฅ์ ์ํด ์ํฅ๋ฐ์ ์ค์ ์ํฐํฐ๋ค์ ๊ฐ์๋ฅผ ๋ํ๋ธ๋ค. joined-subclass ์์ ๋ก "
-"๋๋์๊ฐ๋ฉด, ์๋ธ ํด๋์ค๋ค ์ค ํ๋์ ๋ํ ์ญ์ ๋ ๋จ์ง ๊ทธ ์๋ธํด๋์ค๊ฐ ๋งคํ๋"
-"์ด ์๋ ํ
์ด๋ธ์ ๋ํ ์ญ์ ๋ฟ๋ง ์๋๋ผ ๋ํ \"๋ฃจํธ\" ํ
์ด๋ธ๊ณผ ์์ ๊ณ์ธต์์ "
-"๋ ๋ด๋ ค์จ ์ ์ ์ ์ผ๋ก ์กฐ์ธ๋-์๋ธํด๋์ค ํ
์ด๋ธ๋ค์ ๋ํ ์ญ์ ๋ค๋ก ๊ท๊ฒฐ๋ ์ ์"
-"๋ค."
+#, no-c-format
+msgid "The <literal>int</literal> value returned by the <literal>Query.executeUpdate()</literal> method indicates the number of entities effected by the operation. This may or may not correlate to the number of rows effected in the database. An HQL bulk operation might result in multiple actual SQL statements being executed (for joined-subclass, for example). The returned number indicates the number of actual entities affected by the statement. Going back to the example of joined-subclass, a delete against one of the subclasses may actually result in deletes against not just the table to which that subclass is mapped, but also the \"root\" table and potentially joined-subclass tables further down the inheritance hierarchy."
+msgstr "<literal>Query.executeUpdate()</literal> ๋ฉ์๋์ ์ํด ๋ฐํ๋๋ <literal>int</literal> ๊ฐ์ ๊ทธ ์คํผ๋ ์ด์
์ ์ํด ์ํฅ๋ฐ์ ์ํฐํฐ๋ค์ ๊ฐ์๋ฅผ ๋ํ๋ธ๋ค. ์ด๊ฒ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด์์ ์ํฅ๋ฐ์ ํ๋ค์ ๊ฐ์์ ์๊ด์ด ์์ ์๋ ์์ ์๋ ์๋ค. HQL ๋๋ ์คํผ๋ ์ด์
์ (์๋ฅผ ๋ค์ด joined-subclass์ ๋ํด) ์คํ ์ค์ธ ์ฌ๋ฌ ๊ฐ์ ์ค์ SQL ๋ฌธ์ฅ๋ค๋ก ๊ท๊ฒฐ๋ ์ ์๋ค. ๋ฐํ๋๋ ์ซ์๋ ๊ทธ ๋ฌธ์ฅ์ ์ํด ์ํฅ๋ฐ์ ์ค์ ์ํฐํฐ๋ค์ ๊ฐ์๋ฅผ ๋ํ๋ธ๋ค. joined-subclass ์์ ๋ก ๋๋์๊ฐ๋ฉด, ์๋ธํด๋์ค๋ค ์ค ํ๋์ ๋ํ ์ญ์ ๋ ๋จ์ง ๊ทธ ์๋ธํด๋์ค๊ฐ ๋งคํ๋์ด ์๋ ํ
์ด๋ธ์ ๋ํ ์ญ์ ๋ก ๊ท๊ฒฐ๋ ๋ฟ๋ง ์๋๋ผ ๋ํ \"๋ฃจํธ\" ํ
์ด๋ธ๊ณผ ์์ ๊ณ์ธต์์ ๋ ๋ด๋ ค์จ ์ ์ ์ ์ผ๋ก ์กฐ์ธ๋-์๋ธํด๋์ค ํ
์ด๋ธ๋ค์ ๋ํ ์ญ์ ๋ค๋ก ๊ท๊ฒฐ๋ ์ ์๋ค."
#. Tag: para
#: batch.xml:226
#, no-c-format
-msgid ""
-"The pseudo-syntax for <literal>INSERT</literal> statements is: "
-"<literal>INSERT INTO EntityName properties_list select_statement</literal>. "
-"Some points to note:"
-msgstr ""
-"์ฅ๋์ ๋ฐฐํฌ๋ณธ๋ค์์ ์ ๋ฌ๋ ๋๋ HQL ์คํผ๋ ์ด์
๋ค์ ๋ํ ๋ช ๊ฐ์ง ์ ํ๋ค์ด ํ"
-"์ฌ ์กด์ฌํจ์ ๋
ธํธํ๋ผ; ์์ธํ ๊ฒ์ JIRA ๋ก๋๋งต์ ์ฐธ์กฐํ๋ผ. <literal>INSERT</"
-"literal> ๋ฌธ์ฅ๋ค์ ์ํ ์ ์ฌ-๊ตฌ๋ฌธ์ ๋ค์๊ณผ ๊ฐ๋ค: <literal>INSERT INTO "
-"EntityName properties_list select_statement</literal>. ๋
ธํธํ ๋ช ๊ฐ์ง:"
+msgid "The pseudo-syntax for <literal>INSERT</literal> statements is: <literal>INSERT INTO EntityName properties_list select_statement</literal>. Some points to note:"
+msgstr "์ฅ๋์ ๋ฐฐํฌ๋ณธ๋ค์์ ์ ๋ฌ๋ ๋๋ HQL ์คํผ๋ ์ด์
๋ค์ ๋ํ ๋ช ๊ฐ์ง ์ ํ๋ค์ด ํ์ฌ ์กด์ฌํจ์ ๋
ธํธํ๋ผ; ์์ธํ ๊ฒ์ JIRA ๋ก๋๋งต์ ์ฐธ์กฐํ๋ผ. <literal>INSERT</literal> ๋ฌธ์ฅ๋ค์ ์ํ ์ ์ฌ-๊ตฌ๋ฌธ์ ๋ค์๊ณผ ๊ฐ๋ค: <literal>INSERT INTO EntityName properties_list select_statement</literal>. ๋
ธํธํ ๋ช ๊ฐ์ง:"
#. Tag: para
#: batch.xml:234
#, no-c-format
-msgid ""
-"Only the INSERT INTO ... SELECT ... form is supported; not the INSERT "
-"INTO ... VALUES ... form."
-msgstr ""
-"์ค์ง INSERT INTO ... SELECT ... ํ์ ๋ง์ผ ์ง์๋๋ค; INSERT INTO ... "
-"VALUES ... ํ์์ ์ง์๋์ง ์๋๋ค."
+msgid "Only the INSERT INTO ... SELECT ... form is supported; not the INSERT INTO ... VALUES ... form."
+msgstr "์ค์ง INSERT INTO ... SELECT ... ํ์ ๋ง์ผ ์ง์๋๋ค; INSERT INTO ... VALUES ... ํ์์ ์ง์๋์ง ์๋๋ค."
#. Tag: para
#: batch.xml:237
-#, fuzzy, no-c-format
-msgid ""
-"The properties_list is analogous to the <literal>column specification</"
-"literal> in the SQL <literal>INSERT</literal> statement. For entities "
-"involved in mapped inheritance, only properties directly defined on that "
-"given class-level can be used in the properties_list. Superclass properties "
-"are not allowed and subclass properties do not make sense. In other words, "
-"<literal>INSERT</literal> statements are inherently non-polymorphic."
-msgstr ""
-"properties_list๋ SQL <literal>INSERT</literal> ๋ด์์ <literal>column "
-"speficiation</literal>๊ณผ ์ ์ฌํ๋ค. ๋งคํ๋ ์์์ ์ฐธ์ฌํ๋ ์ํฐํฐ๋ค์ ๊ฒฝ์ฐ, "
-"๊ทธ ์ฃผ์ด์ง ํด๋์ค-๋ ๋ฒจ ์์ ์ง์ ์ ์๋ ํ๋กํผํฐ๋ค ๋ง์ด properties_list์ ์ฌ์ฉ"
-"๋ ์ ์๋ค. ์ํผํด๋์ค ํ๋กํผํฐ๋ค์ ํ์ฉ๋์ง ์๋๋ค; ๊ทธ๋ฆฌ๊ณ ์๋ธํด๋์ค ํ๋กํผ"
-"ํฐ๋ค์ ์๋ฏธ๊ฐ ์๋ค. ๋ฌ๋ฆฌ ๋งํด <literal>INSERT</literal> ๋ฌธ์ฅ๋ค์ ๋ณธ๋์ ์ผ๋ก "
-"๋คํ์ ์ด์ง ์๋ค."
+#, no-c-format
+msgid "The properties_list is analogous to the <literal>column specification</literal> in the SQL <literal>INSERT</literal> statement. For entities involved in mapped inheritance, only properties directly defined on that given class-level can be used in the properties_list. Superclass properties are not allowed and subclass properties do not make sense. In other words, <literal>INSERT</literal> statements are inherently non-polymorphic."
+msgstr "properties_list๋ SQL <literal>INSERT</literal> ๋ฌธ์ฅ์์ <literal>์ปฌ๋ผ ๋ช
์ธ</literal>์ ์ ์ฌํ๋ค. ๋งคํ๋ ์์์ ์ฐธ์ฌํ๋ ์ํฐํฐ๋ค์ ๊ฒฝ์ฐ, ๊ทธ ์ฃผ์ด์ง ํด๋์ค-๋ ๋ฒจ ์์ ์ง์ ์ ์๋ ํ๋กํผํฐ๋ค ๋ง์ด properties_list์ ์ฌ์ฉ๋ ์ ์๋ค. ์ํผํด๋์ค ํ๋กํผํฐ๋ค์ ํ์ฉ๋์ง ์๊ณ , ์๋ธํด๋์ค ํ๋กํผํฐ๋ค์ ์๋ฏธ๊ฐ ์๋ค. ๋ฌ๋ฆฌ ๋งํด <literal>INSERT</literal> ๋ฌธ์ฅ๋ค์ ๋ณธ๋์ ์ผ๋ก ๋คํ์ ์ด์ง ์๋ค(non-polymorphic)."
#. Tag: para
#: batch.xml:247
-#, fuzzy, no-c-format
-msgid ""
-"select_statement can be any valid HQL select query, with the caveat that the "
-"return types must match the types expected by the insert. Currently, this is "
-"checked during query compilation rather than allowing the check to relegate "
-"to the database. This might, however, cause problems between Hibernate "
-"<literal>Type</literal>s which are <emphasis>equivalent</emphasis> as "
-"opposed to <emphasis>equal</emphasis>. This might cause issues with "
-"mismatches between a property defined as a <literal>org.hibernate.type."
-"DateType</literal> and a property defined as a <literal>org.hibernate.type."
-"TimestampType</literal>, even though the database might not make a "
-"distinction or might be able to handle the conversion."
-msgstr ""
-"select_statement๋ ๋ฐํ ํ์
๋ค์ด insert์ ์ํด ๊ธฐ๋๋๋ ํ์
๋ค๊ณผ ์ผ์นํด์ผ ํ"
-"๋ค๋ ๋จ์ ํ์ ์์์ ์ ํจํ HQL select ์ง์์ผ ์ ์๋ค. ํ์ฌ ์ด๊ฒ์ ์ฒดํฌ๋ฅผ ๋ฐ"
-"์ดํฐ๋ฒ ์ด์ค๋ก ์ด๊ด์ํค๋ ๊ฒ์ ํ์ฉํ๊ธฐ ๋ณด๋ค๋ ์ง์ ์ปดํ์ผ ๋์์ ์ฒดํฌ๋๋ค. ํ"
-"์ง๋ง ์ด๊ฒ์ <emphasis>equal</emphasis>๊ณผ๋ ๋์กฐ์ ์ผ๋ก <emphasis>๋ฑ๊ฐ์ธ"
-"(equivalent)</emphasis> Hibernate <literal>Type</literal>๋ค ์ฌ์ด์์ ๋ฌธ์ ์ ๋ค"
-"์ ์ผ์ผํฌ ์๋ ์์์ ๋
ธํธํ๋ผ. ๋น๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ ๊ตฌ๋ณ์ง์ง ์์ ์ ์๊ฑฐ๋ "
-"๋ณํ์ ์ฒ๋ฆฌํ ์ ์์ ์ง๋ผ๋, ์ด๊ฒ์ <literal>org.hibernate.type.DateType</"
-"literal>๋ก์ ์ ์๋ ํ๋กํผํฐ์ <literal>org.hibernate.type.TimestampType</"
-"literal>์ผ๋ก ์ ์๋ ํ๋กํผํฐ ์ฌ์ด์ ๋ถ์ผ์น ์์ ๋ค์ ์ผ์ผํจ๋ค."
+#, no-c-format
+msgid "select_statement can be any valid HQL select query, with the caveat that the return types must match the types expected by the insert. Currently, this is checked during query compilation rather than allowing the check to relegate to the database. This might, however, cause problems between Hibernate <literal>Type</literal>s which are <emphasis>equivalent</emphasis> as opposed to <emphasis>equal</emphasis>. This might cause issues with mismatches between a property defined as a <literal>org.hibernate.type.DateType</literal> and a property defined as a <literal>org.hibernate.type.TimestampType</literal>, even though the database might not make a distinction or might be able to handle the conversion."
+msgstr "๋ฐํ ํ์
๋ค์ด insert์ ์ํด ๊ธฐ๋๋๋ ํ์
๋ค๊ณผ ์ผ์นํด์ผ ํ๋ค๋ ๋จ์ ํ์, select_statement๋ ์์์ ์ ํจํ HQL select ์ง์์ผ ์ ์๋ค. ํ์ฌ ์ด๊ฒ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก ๊ฐ๋ฑ์ํฌ ์ฒดํฌ๋ฅผ ํ์ฉํ๊ธฐ ๋ณด๋ค๋ ์ง์ ์ปดํ์ผ ๋์์ ์ฒดํฌ๋๋ค. ํ์ง๋ง ์ด๊ฒ์ <emphasis>equal</emphasis>๊ณผ๋ ๋์กฐ์ ์ผ๋ก <emphasis>๋ฑ๊ฐ์ธ(equivalent)</emphasis> Hibernate <literal>Type</literal>๋ค ์ฌ์ด์ ๋ฌธ์ ์ ๋ค์ ์ผ์ผํฌ ์๋ ์๋ค. ๋น๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ ๊ตฌ๋ณํ ์ ์๊ฑฐ๋ ๋ณํ์ ์ฒ๋ฆฌํ ์ ์์ ์ง๋ผ๋, ์ด๊ฒ์ <literal>org.hibernate.type.DateType</literal>๋ก ์ ์๋ ํ๋กํผํฐ์ <literal>org.hibernate.type.TimestampType</literal>์ผ๋ก ์ ์๋ ํ๋กํผํฐ ์ฌ์ด์ ๋ถ์ผ์น ์์ ๋ค์ ์ ๋ฐ์ํฌ ์๋ ์๋ค."
#. Tag: para
#: batch.xml:259
-#, fuzzy, no-c-format
-msgid ""
-"For the id property, the insert statement gives you two options. You can "
-"either explicitly specify the id property in the properties_list, in which "
-"case its value is taken from the corresponding select expression, or omit it "
-"from the properties_list, in which case a generated value is used. This "
-"latter option is only available when using id generators that operate in the "
-"database; attempting to use this option with any \"in memory\" type "
-"generators will cause an exception during parsing. For the purposes of this "
-"discussion, in-database generators are considered to be <literal>org."
-"hibernate.id.SequenceGenerator</literal> (and its subclasses) and any "
-"implementers of <literal>org.hibernate.id.PostInsertIdentifierGenerator</"
-"literal>. The most notable exception here is <literal>org.hibernate.id."
-"TableHiLoGenerator</literal>, which cannot be used because it does not "
-"expose a selectable way to get its values."
-msgstr ""
-"id ํ๋กํผํฐ์ ๊ฒฝ์ฐ, insert ๋ฌธ์ฅ์ ๋น์ ์๊ฒ ๋ ๊ฐ์ ์ต์
์ ์ค๋ค. ๋น์ ์ "
-"properties_list ๋ด์ id ํ๋กํผํฐ๋ฅผ ๋ช
์์ ์ผ๋ก ์ง์ ํ ์ ์๊ฑฐ๋(๊ทธ๊ฒ์ ๊ฐ์ด ๋"
-"์ํ๋ select ํํ์์ผ๋ก๋ถํฐ ์ป์ด์ง ๊ฒฝ์ฐ) ๋๋ properties_list์์ ๊ทธ๊ฒ์ ์"
-"๋ตํ ์๋ ์๋ค (์ฐ์ถ๋ ๊ฐ์ด ์ฌ์ฉ๋๋ ๊ฒฝ์ฐ). ์ด ํ์์ ์ต์
์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด"
-"์์ ์ฐ์ฐ๋๋ id ์ฐ์ฐ์๋ค์ ์ฌ์ฉํ ๋์๋ง ์ด์ฉ ๊ฐ๋ฅํ๋ค; ์์์ \"๋ฉ๋ชจ๋ฆฌ ๋ด"
-"\" ํ์
์ฐ์ฐ์๋ค๊ณผ ํจ๊ป ์ด ์ต์
์ ์ฌ์ฉํ๋ ค๊ณ ์๋ํ๋ ๊ฒ์ ํ์ฑ ๋์์ ์์ธ์"
-"ํฉ์ ์ผ์ผํฌ ๊ฒ์ด๋ค. ์ด ๋
ผ์์ ๋ชฉ์ ์, ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด ์ฐ์ถ์(generator)๋ค์ "
-"<literal>org.hibernate.id.SequenceGenerator</literal> (๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ ์๋ธํด๋"
-"์ค๋ค) ๊ทธ๋ฆฌ๊ณ ์์์ <literal>org.hibernate.id.PostInsertIdentifierGenerator</"
-"literal>์ ๊ตฌํ์๋ค์ด๋ผ๊ณ ๊ฐ์ฃผ๋จ์ ๋
ธํธํ๋ผ. ์ฌ๊ธฐ์ ๊ฐ์ฅ ์ฃผ๋ชฉํ ๋งํ ์์ธ์ํฉ"
-"์ ๊ทธ๊ฒ์ด ๊ทธ๊ฒ์ ๊ฐ๋ค์ ์ป๊ธฐ ์ํ select ๊ฐ๋ฅํ ๋ฐฉ๋ฒ์ ๋
ธ์ถ์ํค์ง ์๊ธฐ ๋๋ฌธใ
"
-"์ ์ฌ์ฉ๋ ์ ์๋ <literal>org.hibernate.id.TableHiLoGenerator</literal>์ด๋ค."
+#, no-c-format
+msgid "For the id property, the insert statement gives you two options. You can either explicitly specify the id property in the properties_list, in which case its value is taken from the corresponding select expression, or omit it from the properties_list, in which case a generated value is used. This latter option is only available when using id generators that operate in the database; attempting to use this option with any \"in memory\" type generators will cause an exception during parsing. For the purposes of this discussion, in-database generators are considered to be <literal>org.hibernate.id.SequenceGenerator</literal> (and its subclasses) and any implementers of <literal>org.hibernate.id.PostInsertIdentifierGenerator</literal>. The most notable exception here is <literal>org.hibernate.id.TableHiLoGenerator</literal>, which cannot be used because it does not expose a selectable way to get its values."
+msgstr "id ํ๋กํผํฐ์ ๊ฒฝ์ฐ, insert ๋ฌธ์ฅ์ ๋น์ ์๊ฒ ๋ ๊ฐ์ ์ต์
์ ์ค๋ค. ๋น์ ์ properties_list ๋ด์ id ํ๋กํผํฐ๋ฅผ ๋ช
์์ ์ผ๋ก ์ง์ ํ ์ ์๋๋ฐ ์ด ๊ฒฝ์ฐ์ ๊ทธ๊ฒ์ ๊ฐ์ ๋์ํ๋ SELECT ํํ์์ผ๋ก๋ถํฐ ์ป์ด์ง๋ค. ๋๋ properties_list์์ ๊ทธ๊ฒ์ ์๋ตํ ์ ์๋๋ฐ ์ด ๊ฒฝ์ฐ์ ์์ฑ๋ ๊ฐ์ด ์ฌ์ฉ๋๋ค. ์ด ํ์์ ์ต์
์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด์์ ์ฐ์ฐ๋๋ id ์ฐ์ฐ์๋ค์ ์ฌ์ฉํ ๋์๋ง ์ด์ฉ ๊ฐ๋ฅํ๋ค; ์์์ \"๋ฉ๋ชจ๋ฆฌ ๋ด\" ํ์
์์ฑ๊ธฐ๋ค๋ก์ ์ด ์ต์
์ ์ฌ์ฉํ๊ณ ์ ์๋ํ๋ ๊ฒ์ ํ์ฑ ๋์์ ์์ธ์ํฉ์ ์ผ์ผํฌ ๊ฒ์ด๋ค. ์ด ๋
ผ์์ ๋ชฉ์ ์, ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด ์์ฑ๊ธฐ๋ค์ <literal>org.hibernate.id.SequenceGenerator</literal> (๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ ์๋ธํด๋์ค๋ค) ๊ทธ๋ฆฌ๊ณ ์์์ <literal>org.hibernate.id.PostInsertIdentifierGenerator</literal>์ ๊ตฌํ์๋ค์ด๋ผ๊ณ ๊ฐ์ฃผ๋๋ค. ์ฌ๊ธฐ์ ๊ฐ์ฅ ์ฃผ๋ชฉํ ๋งํ ์๏ฟฝ!
๏ฟฝ๏ฟฝ๋ <literal>org.hibernate.id.TableHiLoGenerator</literal>์ธ๋ฐ, ๊ทธ๊ฒ์ด ๊ทธ๊ฒ์ ๊ฐ๋ค์ ์ป๊ธฐ ์ํ select ๊ฐ๋ฅํ ๋ฐฉ๋ฒ์ ๋
ธ์ถ์ํค์ง ์๊ธฐ ๋๋ฌธ์ ์ฌ์ฉ๋ ์ ์๋ค."
#. Tag: para
#: batch.xml:274
-#, fuzzy, no-c-format
-msgid ""
-"For properties mapped as either <literal>version</literal> or "
-"<literal>timestamp</literal>, the insert statement gives you two options. "
-"You can either specify the property in the properties_list, in which case "
-"its value is taken from the corresponding select expressions, or omit it "
-"from the properties_list, in which case the <literal>seed value</literal> "
-"defined by the <literal>org.hibernate.type.VersionType</literal> is used."
-msgstr ""
-"<literal>version</literal> ๋๋ <literal>timestamp</literal>๋ก์ ๋งคํ๋ ํ๋ก"
-"ํผํฐ๋ค์ ๊ฒฝ์ฐ์, insert ๋ฌธ์ฅ์ ๋น์ ์๊ฒ ๋ ๊ฐ์ ์ต์
๋ค์ ์ค๋ค. ๋น์ ์ "
-"properties_list ๋ด์ ๊ทธ ํ๋กํผํฐ๋ฅผ ์ง์ ํ ์ ์๊ฑฐ๋ (๊ทธ ๊ฒ์ ๊ฐ์ด ๋์ํ๋ "
-"select ํํ์์ผ๋ก๋ถํฐ ์ป์ด์ง ๊ฒฝ์ฐ) ๋๋ properties_list์์ ๊ทธ๊ฒ์ ์๋ตํ ์ "
-"์๋ค (<literal>org.hibernate.type.VersionType</literal>์ ์ํด ์ ์๋ "
-"<literal>seed value</literal> ๊ฐ์ด ์ฌ์ฉ๋๋ ๊ฒฝ์ฐ)."
+#, no-c-format
+msgid "For properties mapped as either <literal>version</literal> or <literal>timestamp</literal>, the insert statement gives you two options. You can either specify the property in the properties_list, in which case its value is taken from the corresponding select expressions, or omit it from the properties_list, in which case the <literal>seed value</literal> defined by the <literal>org.hibernate.type.VersionType</literal> is used."
+msgstr "<literal>version</literal> ๋๋ <literal>timestamp</literal>๋ก ๋งคํ๋ ํ๋กํผํฐ๋ค์ ๊ฒฝ์ฐ์, insert ๋ฌธ์ฅ์ ๋น์ ์๊ฒ ๋ ๊ฐ์ ์ต์
๋ค์ ์ค๋ค. ๋น์ ์ properties_list ๋ด์ ๊ทธ ํ๋กํผํฐ๋ฅผ ์ง์ ํ ์ ์๋๋ฐ ๊ทธ ๊ฒฝ์ฐ ๊ทธ๊ฒ์ ๊ฐ์ด ๋์ํ๋ select ํํ์์ผ๋ก๋ถํฐ ์ป์ด์ง๋ค. ๋๋ ๋น์ ์ properties_list์์ ๊ทธ๊ฒ์ ์๋ตํ ์ ์๋๋ฐ ๊ทธ ๊ฒฝ์ฐ์ <literal>org.hibernate.type.VersionType</literal>์ ์ํด ์ ์๋ <literal>seed value</literal> ๊ฐ์ด ์ฌ์ฉ๋๋ค."
#. Tag: para
#: batch.xml:284
-#, fuzzy, no-c-format
-msgid ""
-"The following is an example of an HQL <literal>INSERT</literal> statement "
-"execution:"
-msgstr "์์ HQL <literal>INSERT</literal> ๋ฌธ์ฅ ์คํ:"
+#, no-c-format
+msgid "The following is an example of an HQL <literal>INSERT</literal> statement execution:"
+msgstr "๋ค์์ HQL <literal>INSERT</literal> ๋ฌธ์ฅ ์คํ ์์ ์ด๋ค:"
#. Tag: programlisting
#: batch.xml:288
@@ -634,10 +451,18 @@
"<![CDATA[Session session = sessionFactory.openSession();\n"
"Transaction tx = session.beginTransaction();\n"
"\n"
-"String hqlInsert = \"insert into DelinquentAccount (id, name) select c.id, c."
-"name from Customer c where ...\";\n"
+"String hqlInsert = \"insert into DelinquentAccount (id, name) select c.id, c.name from Customer c where ...\";\n"
"int createdEntities = s.createQuery( hqlInsert )\n"
" .executeUpdate();\n"
"tx.commit();\n"
"session.close();]]>"
msgstr ""
+"<![CDATA[Session session = sessionFactory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"String hqlInsert = \"insert into DelinquentAccount (id, name) select c.id, c.name from Customer c where ...\";\n"
+"int createdEntities = s.createQuery( hqlInsert )\n"
+" .executeUpdate();\n"
+"tx.commit();\n"
+"session.close();]]>"
+
14ย years, 4ย months