[Hibernate-JIRA] Updated: (ANN-28) @Any
by Alexander Portnov (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-28?page=all ]
Alexander Portnov updated ANN-28:
---------------------------------
Attachment: annotations-any-patch.txt
Implementation of @Any and @ManyToAny annotations.
Following are syntax examples:
@Any(idType="integer", metaType="string",
metaValues={
@MetaValue(value="S",targetEntity=StringProperty.class),
@MetaValue(value="I",targetEntity=IntegerProperty.class)},
columns = {
@Column(name="property_type"),
@Column(name="property_id")},
cascade= CascadeType.ALL)
public Property getSomeProperty() {
return someProperty;
}
@ManyToAny(idType="integer", metaType="string",
metaValues={
@MetaValue(value="S", targetEntity=StringProperty.class),
@MetaValue(value="I", targetEntity=IntegerProperty.class)},
columns = {
@Column(name="property_type"),
@Column(name="property_id")})
@Cascade({org.hibernate.annotations.CascadeType.ALL})
@JoinTable(name="obj_properties", joinColumns = {@JoinColumn(name="obj_id")})
public List<Property> getGeneralProperties() {
return generalProperties;
}
@ManyToAny(idType="integer", metaType="string",
metaValues={
@MetaValue(value="S", targetEntity=StringProperty.class),
@MetaValue(value="I", targetEntity=IntegerProperty.class)},
columns = {
@Column(name="property_type"),
@Column(name="property_id")})
@Cascade({org.hibernate.annotations.CascadeType.ALL})
@JoinTable(name="map_properties", joinColumns = {@JoinColumn(name="map_id")})
@MapKey(columns = {@Column(name="map_key")})
public Map<String, Property> getProperties() {
return properties;
}
> @Any
> ----
>
> Key: ANN-28
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-28
> Project: Hibernate Annotations
> Type: Improvement
> Components: binder
> Versions: 3.1beta3
> Reporter: Emmanuel Bernard
> Priority: Trivial
> Attachments: annotations-any-patch.txt
>
>
> @AnyValue(value="", class="") //or MetaValue?
> @Any(idType="", metaType="", metaValues={@MetaValue()}, columns={@Column()})
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1409) Packaging of Hibernate binaries
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1409?page=c... ]
Max Rydahl Andersen commented on HHH-1409:
------------------------------------------
fyi build.xml already contains the jar task for building the same hibernate-client.jar...but not finalized yet (so just for testing) .....feel free to give feedback on it.
> Packaging of Hibernate binaries
> -------------------------------
>
> Key: HHH-1409
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1409
> Project: Hibernate3
> Type: Improvement
> Components: build
> Reporter: Markus Jessenitschnig
> Priority: Minor
>
>
> We are using Hibernate in a typical client/server environment. Up to now we need to have the hibernate.jar file on the classpath of both JVMs because on the client side, Hibernate Exception classes as well as Collection classes needs to be found at runtime. Well, it would be possible to take care, that all exceptions are converted into application exceptions (no hibernate exceptions set as cause) and all collections are copied into collections of type java.util.Collection. Obviously this will remove the need of a hibernate.jar file on the client side, but the advantages of e.g. persistent collections are lost.
> To keep the size of the client side distribution small, it would be nice to have only classes on the client side classpath which are really needed (I'm not sure if exception and collection classes are enough). For that reason I would suggest to split the hibernate3.jar of the distribution into two parts. A hibernate-common.jar which contains classes needed on the client and the server side of the application, and a hibernate-server.jar which only contains classes needed on the server side of the application.
> kind regards
> Markus Jessenitschnig
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Created: (HHH-2168) SQLQuery - use rowIndex for scalar queries
by Luiz dos Santos Faias Junior (JIRA)
SQLQuery - use rowIndex for scalar queries
------------------------------------------
Key: HHH-2168
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2168
Project: Hibernate3
Type: Improvement
Components: query-sql
Versions: 3.2.0.ga
Environment: Hibernate 3.2.0.ga
Oracle 10g Database
Reporter: Luiz dos Santos Faias Junior
Priority: Minor
When org.hibernate.SQLQuery is used the default column types are java.sql.Date and java.math.BigDecimal.
If I need to specify the types I use addScalar for all columns, but if I'm making a report probably there will be a few columns I want the default type.
So my suggestion is to create a method :
addScalar(java.lang.String columnAlias, org.hibernate.type.Type type, int columnIndex);
or
addScalar(int columnIndex, org.hibernate.type.Type type);
Example :
SQLQuery query = session.createSQLQuery( " select user_id, user_name, last_login from users " );
where last_login should be a java.sql.Timestamp.
I want the first and second columns to use the default type ( int and String ), and the third column I want to specify Timestamp instead of java.sql.Date
So I could only write : query.addScalar("last_login", Hibernate,.TIMESTAMP, 2);
or addScalar(2, Hibernate.TIMESTAMP); (using the columnIndex).
thanks,
Luiz Faias
São Paulo - Brasil
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Created: (ANN-458) Hibernate Validator initialization always requires keys in ValidatorMessges.properties
by Christian Bauer (JIRA)
Hibernate Validator initialization always requires keys in ValidatorMessges.properties
--------------------------------------------------------------------------------------
Key: ANN-458
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-458
Project: Hibernate Annotations
Type: Bug
Components: binder
Reporter: Christian Bauer
Priority: Critical
Seam + Hibernate Validator doesn't work. When AnnotationConfiguration boots, it always uses the DefaultMessageInterpolator (this is actually a separate problem, not only the event listeners should use the configured interpolator) and the default interpolator always throws an exception if the message key can't be found.
This is an even bigger problem if you don't want or have a ValidatorMessages.properties file, like in a typical Seam application where everything is in messages.properties (Seam managed component). You can't override or set the resource bundle that is used on startup.
A quick fix would be to not throw an exception in DefaultMessageInterpolator if the key can't be found in the resource bundle. The key should then be returned as the message. I see no reason why that shouldn't work, it's the users own fault if he forgot the key. It's also the regular behavior in JSF.
This is my quick hack to make it work, in DefaultMessageInterpolator:
String string = null;
try {
string = messageBundle != null ? messageBundle.getString( token ) : null;
}
catch( MissingResourceException e ) {
//give a second chance with the default resource bundle
}
if (string == null) {
try {
string = defaultMessageBundle.getString( token );
}
catch( MissingResourceException e) {
return message;
/* We don't want that:
throw new MissingResourceException(
"Can't find resource in validator bundles, key " + token,
defaultMessageBundle.getClass().getName(),
token
);
*/
}
}
I'm writing now about this in the JPwH book, so I expect that I can in the future simply have messages.properties for Seam with my Hibernate Validator messages. This fix has to be in 3.2.1.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months