Skip to content

Commit

Permalink
Added missing hibernate-orm files due to some .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Apr 4, 2024
1 parent bca94f2 commit 2fbb70b
Show file tree
Hide file tree
Showing 20,342 changed files with 2,347,319 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.hibernate.result;

/**
* Defines support for dealing with database results, accounting for mixed result sets and update counts hiding the
* complexity (IMO) of how this is exposed in the JDBC API.
*
* {@link Result} represents the overall group of results.
*
* {@link Return} represents the mixed individual outcomes, which might be either a {@link ResultSetReturn} or
* a {@link UpdateCountReturn}.
*
* <code>
* Result result = ...;
* while ( result.hasMoreReturns() ) {
* final Return rtn = result.getNextReturn();
* if ( rtn.isResultSet() ) {
* handleResultSetReturn( (ResultSetReturn) rtn );
* }
* else {
* handleUpdateCountReturn( (UpdateCountReturn) rtn );
* }
* }
* </code>
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//$Id$
package org.hibernate.test.annotations.target;

import java.util.HashMap;
import java.util.Map;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.MapKey;
import org.hibernate.annotations.MapKeyManyToMany;

/**
* @author Emmanuel Bernard
*/
@Entity
public class Brand {
@Id
@GeneratedValue
private Long id;

@ManyToMany(targetEntity = LuggageImpl.class)
@MapKey(targetElement = SizeImpl.class)
private Map<Size, Luggage> luggagesBySize = new HashMap<Size, Luggage>();

@ElementCollection(targetClass = SizeImpl.class)
@MapKeyManyToMany(targetEntity = LuggageImpl.class)
private Map<Luggage, Size> sizePerLuggage = new HashMap<Luggage, Size>();


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Map<Size, Luggage> getLuggagesBySize() {
return luggagesBySize;
}

public void setLuggagesBySize(Map<Size, Luggage> luggagesBySize) {
this.luggagesBySize = luggagesBySize;
}

public Map<Luggage, Size> getSizePerLuggage() {
return sizePerLuggage;
}

public void setSizePerLuggage(Map<Luggage, Size> sizePerLuggage) {
this.sizePerLuggage = sizePerLuggage;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.hibernate.result;

/**
* Defines support for dealing with database results, accounting for mixed result sets and update counts hiding the
* complexity (IMO) of how this is exposed in the JDBC API.
*
* {@link Result} represents the overall group of results.
*
* {@link Return} represents the mixed individual outcomes, which might be either a {@link ResultSetReturn} or
* a {@link UpdateCountReturn}.
*
* <code>
* Result result = ...;
* while ( result.hasMoreReturns() ) {
* final Return rtn = result.getNextReturn();
* if ( rtn.isResultSet() ) {
* handleResultSetReturn( (ResultSetReturn) rtn );
* }
* else {
* handleUpdateCountReturn( (UpdateCountReturn) rtn );
* }
* }
* </code>
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//$Id$
package org.hibernate.test.annotations.target;

import java.util.HashMap;
import java.util.Map;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.MapKeyClass;

import org.hibernate.annotations.MapKeyManyToMany;

/**
* @author Emmanuel Bernard
*/
@Entity
public class Brand {
@Id
@GeneratedValue
private Long id;

@ManyToMany(targetEntity = LuggageImpl.class)
@MapKeyClass(SizeImpl.class)
private Map<Size, Luggage> luggagesBySize = new HashMap<Size, Luggage>();

@ElementCollection(targetClass = SizeImpl.class)
@MapKeyClass(LuggageImpl.class)
@MapKeyManyToMany //legacy column name: was never officially supported BTW
private Map<Luggage, Size> sizePerLuggage = new HashMap<Luggage, Size>();


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Map<Size, Luggage> getLuggagesBySize() {
return luggagesBySize;
}

public void setLuggagesBySize(Map<Size, Luggage> luggagesBySize) {
this.luggagesBySize = luggagesBySize;
}

public Map<Luggage, Size> getSizePerLuggage() {
return sizePerLuggage;
}

public void setSizePerLuggage(Map<Luggage, Size> sizePerLuggage) {
this.sizePerLuggage = sizePerLuggage;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//$Id$
package org.hibernate.test.annotations.target;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.Embedded;

import org.hibernate.annotations.Target;

/**
* @author Emmanuel Bernard
*/
@Entity
public class LuggageImpl implements Luggage {
private Long id;
private double height;
private double width;
private Owner owner;

@Embedded
@Target(OwnerImpl.class)
public Owner getOwner() {
return owner;
}

public void setOwner(Owner owner) {
this.owner = owner;
}

@Id
@GeneratedValue
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public double getHeight() {
return height;
}

public void setHeight(double height) {
this.height = height;
}

public double getWidth() {
return width;
}

public void setWidth(double width) {
this.width = width;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//$Id$
package org.hibernate.test.annotations.target;

import java.util.HashMap;
import java.util.Map;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.MapKey;
import org.hibernate.annotations.MapKeyManyToMany;

/**
* @author Emmanuel Bernard
*/
@Entity
public class Brand {
@Id
@GeneratedValue
private Long id;

@ManyToMany(targetEntity = LuggageImpl.class)
@MapKey(targetElement = SizeImpl.class)
private Map<Size, Luggage> luggagesBySize = new HashMap<Size, Luggage>();

@ElementCollection(targetClass = SizeImpl.class)
@MapKeyManyToMany(targetEntity = LuggageImpl.class)
//TODO @MapKeyClass(LuggageImpl.class)
private Map<Luggage, Size> sizePerLuggage = new HashMap<Luggage, Size>();


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Map<Size, Luggage> getLuggagesBySize() {
return luggagesBySize;
}

public void setLuggagesBySize(Map<Size, Luggage> luggagesBySize) {
this.luggagesBySize = luggagesBySize;
}

public Map<Luggage, Size> getSizePerLuggage() {
return sizePerLuggage;
}

public void setSizePerLuggage(Map<Luggage, Size> sizePerLuggage) {
this.sizePerLuggage = sizePerLuggage;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//$Id$
package org.hibernate.test.annotations.target;

import java.util.Map;
import java.util.HashMap;
import javax.persistence.Embeddable;
import org.hibernate.annotations.MapKey;
import javax.persistence.ManyToMany;

/**
* @author Emmanuel Bernard
*/
@Embeddable
public class OwnerImpl implements Owner {
private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//$Id$
package org.hibernate.test.annotations.target;

import java.util.HashMap;
import java.util.Map;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.MapKeyClass;

import org.hibernate.annotations.MapKey;
import org.hibernate.annotations.MapKeyManyToMany;

/**
* @author Emmanuel Bernard
*/
@Entity
public class Brand {
@Id
@GeneratedValue
private Long id;

@ManyToMany(targetEntity = LuggageImpl.class)
@MapKeyClass(SizeImpl.class)
private Map<Size, Luggage> luggagesBySize = new HashMap<Size, Luggage>();

@ElementCollection(targetClass = SizeImpl.class)
@MapKeyManyToMany(targetEntity = LuggageImpl.class)
//TODO @MapKeyClass(LuggageImpl.class)
private Map<Luggage, Size> sizePerLuggage = new HashMap<Luggage, Size>();


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Map<Size, Luggage> getLuggagesBySize() {
return luggagesBySize;
}

public void setLuggagesBySize(Map<Size, Luggage> luggagesBySize) {
this.luggagesBySize = luggagesBySize;
}

public Map<Luggage, Size> getSizePerLuggage() {
return sizePerLuggage;
}

public void setSizePerLuggage(Map<Luggage, Size> sizePerLuggage) {
this.sizePerLuggage = sizePerLuggage;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//$Id$
package org.hibernate.test.annotations.target;

import javax.persistence.Embeddable;

/**
* @author Emmanuel Bernard
*/
@Embeddable
public class OwnerImpl implements Owner {
private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
Loading

0 comments on commit 2fbb70b

Please sign in to comment.