openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Prud'hommeaux <mprud...@apache.org>
Subject Re: Validate and @table schema use
Date Tue, 24 Apr 2007 18:27:46 GMT
Phill-

This does sound like a bug to me. Can you open a JIRA issue with the  
information?



On Apr 23, 2007, at 4:12 PM, Phill Moran wrote:

> I can toggle this exception on/off by adding the schema statement.  
> I was running
> validate on my country class that persists to the country table on a
> table-per-class inheritance strategy. Using 0.9.6 openJPA
>
> 16  TRACE  [main] openjpa.Runtime - Setting the following  
> properties from
> "file:/C:/BidSpec/emall/development/emall/src/main/resources/META- 
> INF/persistenc
> e.xml" into configuration: {openjpa.DetachState=loaded,  
> openjpa.DataCache=false,
> openjpa.Optimistic=true, openjpa.NontransactionalRead=true,
> javax.persistence.provider=org.apache.openjpa.persistence.PersistenceP 
> roviderImp
> l, openjpa.jdbc.DBDictionary=mysql(SupportsSubselect=true),
> openjpa.Log=DefaultLevel=TRACE, Runtime=TRACE, Enhance=TRACE,  
> Tool=TRACE,
> SQL=TRACE, openjpa.ConnectionUserName=user,  
> openjpa.ConnectionPassword=password,
> openjpa.ConnectionDriverName=com.mysql.jdbc.Driver,
> openjpa.MetaDataFactory=Types=ca.BidSpec.emall.categories.Attribute;ca 
> .BidSpec.e
> mall.categories.AttributeType;ca.BidSpec.emall.categories.Category;ca. 
> BidSpec.em
> all.categories.CategoryType;ca.BidSpec.emall.categories.Country;ca.Bid 
> Spec.emall
> .categories.Division;ca.BidSpec.emall.categories.DivisionType;ca.BidSp 
> ec.emall.c
> ategories.ImageType;ca.BidSpec.emall.categories.ProductComponent;ca.Bi 
> dSpec.emal
> l.categories.ProductRequiredOptional;ca.BidSpec.emall.categories.Produ 
> ctType;ca.
> BidSpec.emall.categories.Province;ca.BidSpec.emall.categories.Subdivis 
> ion;ca.Bid
> Spec.emall.commonServices.EmailAddress;ca.BidSpec.emall.commonServices 
> .Image;ca.
> BidSpec.emall.commonServices.InitializerActivity;ca.BidSpec.emall.comm 
> onServices
> .PhoneNumber;ca.BidSpec.emall.commonServices.PropertyMap;ca.BidSpec.em 
> all.common
> Services.Size;ca.BidSpec.emall.commonServices.StreetAddress;ca.BidSpec 
> .emall.com
> monServices.WebAddress;ca.BidSpec.emall.money.Currency;ca.BidSpec.emal 
> l.money.Pr
> ice;ca.BidSpec.emall.persistence.Persistable;ca.BidSpec.emall.products 
> .Product;c
> a.BidSpec.emall.stores.Store;ca.BidSpec.emall.user.Person,
> openjpa.AutoDetach=close, openjpa.OrphanedKeyAction=log,
> openjpa.Multithreaded=true,
> openjpa.ConnectionURL=jdbc:mysql://dell600:3306/bidspec}
> 141  TRACE  [main] openjpa.MetaData - Using metadata factory
> "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@125fefa 
> ".
> 188  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> "org.apache.openjpa.jdbc.sql.MySQLDictionary".
> 266  INFO   [main] openjpa.Tool - Mapping tool running on type "class
> ca.BidSpec.emall.categories.Country" with action "validate".
> 282  TRACE  [main] openjpa.MetaData - Using metadata factory
> "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@766a24" 
> .
> 297  TRACE  [main] openjpa.MetaData - Loading metadata for "class
> ca.BidSpec.emall.categories.Country" under mode "[META][QUERY]".
> 297  INFO   [main] openjpa.MetaData - Found 27 classes with  
> metadata in 0
> milliseconds.
> 360  INFO   [main] openjpa.MetaData - Parsing class
> "ca.BidSpec.emall.categories.Country".
> 360  INFO   [main] openjpa.MetaData - Parsing package
> "ca.BidSpec.emall.categories.Country".
> 469  TRACE  [main] openjpa.MetaData - Generating default metadata  
> for type
> "ca.BidSpec.emall.categories.Country".
> 469  TRACE  [main] openjpa.MetaData - Using reflection for metadata  
> generation.
> 516  INFO   [main] openjpa.MetaData - Parsing query "CountryFXPK".
> 516  INFO   [main] openjpa.MetaData - Parsing query "CountryF".
> 547  TRACE  [main] openjpa.MetaData - Loading metadata for "class
> ca.BidSpec.emall.persistence.Persistable" under mode "[META][QUERY]".
> 547  INFO   [main] openjpa.MetaData - Parsing class
> "ca.BidSpec.emall.persistence.Persistable".
> 547  INFO   [main] openjpa.MetaData - Parsing package
> "ca.BidSpec.emall.persistence.Persistable".
> 563  TRACE  [main] openjpa.MetaData - Generating default metadata  
> for type
> "ca.BidSpec.emall.persistence.Persistable".
> 563  TRACE  [main] openjpa.MetaData - Using reflection for metadata  
> generation.
> 563  TRACE  [main] openjpa.MetaData - Set persistence-capable  
> superclass of
> "ca.BidSpec.emall.persistence.Persistable" to "null".
> 563  TRACE  [main] openjpa.MetaData - Resolving metadata for
> "ca.BidSpec.emall.persistence.Persistable@28524838".
> 563  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.persistence.Persistable@28524838.id".
> 578  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.persistence.Persistable@28524838.lastUpdated".
> 594  TRACE  [main] openjpa.MetaData - Preparing mapping for
> "ca.BidSpec.emall.persistence.Persistable".
> 594  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.persistence.Persistable@28524838.id".
> 594  TRACE  [main] openjpa.MetaData - 	"id" has mapping strategy  
> "none".
> 594  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.persistence.Persistable@28524838.lastUpdated".
> 594  TRACE  [main] openjpa.MetaData - 	"lastUpdated" has mapping  
> strategy
> "none".
> 594  TRACE  [main] openjpa.MetaData -
> "ca.BidSpec.emall.persistence.Persistable<discriminator>" has  
> mapping strategy
> "none".
> 610  TRACE  [main] openjpa.MetaData -
> "ca.BidSpec.emall.persistence.Persistable<version>" has mapping  
> strategy "none".
> 610  TRACE  [main] openjpa.MetaData - Resolving mapping for
> "ca.BidSpec.emall.persistence.Persistable@28524838".
> 610  TRACE  [main] openjpa.MetaData -  
> "ca.BidSpec.emall.persistence.Persistable"
> has mapping strategy "none".
> 610  TRACE  [main] openjpa.MetaData - Set persistence-capable  
> superclass of
> "ca.BidSpec.emall.categories.Country" to "class
> ca.BidSpec.emall.persistence.Persistable".
> 610  TRACE  [main] openjpa.MetaData - Resolving metadata for
> "ca.BidSpec.emall.categories.Country@6771926".
> 610  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.categories.Country@6771926.code".
> 610  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.categories.Country@6771926.displayName".
> 610  TRACE  [main] openjpa.MetaData - 	Resolving field
> "ca.BidSpec.emall.categories.Country@6771926.name".
> 610  TRACE  [main] openjpa.MetaData - Preparing mapping for
> "ca.BidSpec.emall.categories.Country".
> 907  TRACE  [main] openjpa.jdbc.JDBC - catalogSeparator: .
> catalogTerm: database
> databaseProductName: MySQL
> databaseProductVersion: 5.0.24a-community-nt
> driverName: MySQL-AB JDBC Driver
> driverVersion: mysql-connector-java-5.0.4 ( $Date: 2006-10-19  
> 17:47:48 +0200
> (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
> extraNameCharacters: #@
> identifierQuoteString: `
> numericFunctions:
> ABS,ACOS,ASIN,ATAN,ATAN2,BIT_COUNT,CEILING,COS,COT,DEGREES,EXP,FLOOR,L 
> OG,LOG10,M
> AX,MIN,MOD,PI,POW,POWER,RADIANS,RAND,ROUND,SIN,SQRT,TAN,TRUNCATE
> procedureTerm: PROCEDURE
> schemaTerm:
> searchStringEscape: \
> sqlKeywords:
> AUTO_INCREMENT,BINARY,BLOB,ENUM,INFILE,LOAD,MEDIUMINT,OPTION,OUTFILE,R 
> EPLACE,SET
> ,TEXT,UNSIGNED,ZEROFILL
> stringFunctions:
> ASCII,BIN,BIT_LENGTH,CHAR,CHARACTER_LENGTH,CHAR_LENGTH,CONCAT,CONCAT_W 
> S,CONV,ELT
> ,EXPORT_SET,FIELD,FIND_IN_SET,HEX,INSERT,INSTR,LCASE,LEFT,LENGTH,LOAD_ 
> FILE,LOCAT
> E,LOCATE,LOWER,LPAD,LTRIM,MAKE_SET,MATCH,MID,OCT,OCTET_LENGTH,ORD,POSI 
> TION,QUOTE
> ,REPEAT,REPLACE,REVERSE,RIGHT,RPAD,RTRIM,SOUNDEX,SPACE,STRCMP,SUBSTRIN 
> G,SUBSTRIN
> G,SUBSTRING,SUBSTRING,SUBSTRING_INDEX,TRIM,UCASE,UPPER
> systemFunctions:
> DATABASE,USER,SYSTEM_USER,SESSION_USER,PASSWORD,ENCRYPT,LAST_INSERT_ID 
> ,VERSION
> timeDateFunctions:
> DAYOFWEEK,WEEKDAY,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,MONTHNAME,QUARTER 
> ,WEEK,YEAR
> ,HOUR,MINUTE,SECOND,PERIOD_ADD,PERIOD_DIFF,TO_DAYS,FROM_DAYS,DATE_FORM 
> AT,TIME_FO
> RMAT,CURDATE,CURRENT_DATE,CURTIME,CURRENT_TIME,NOW,SYSDATE,CURRENT_TIM 
> ESTAMP,UNI
> X_TIMESTAMP,FROM_UNIXTIME,SEC_TO_TIME,TIME_TO_SEC
> url: jdbc:mysql://dell600:3306/bidspec
> userName: bidspec@TYAN2400
> defaultTransactionIsolation: 2
> driverMajorVersion: 5
> driverMinorVersion: 0
> maxBinaryLiteralLength: 16777208
> maxCatalogNameLength: 32
> maxCharLiteralLength: 16777208
> maxColumnNameLength: 64
> maxColumnsInGroupBy: 64
> maxColumnsInIndex: 16
> maxColumnsInOrderBy: 64
> maxColumnsInSelect: 256
> maxColumnsInTable: 512
> maxConnections: 0
> maxCursorNameLength: 64
> maxIndexLength: 256
> maxProcedureNameLength: 0
> maxRowSize: 2147483639
> maxSchemaNameLength: 0
> maxStatementLength: 65531
> maxStatements: 0
> maxTableNameLength: 64
> maxTablesInSelect: 256
> maxUserNameLength: 16
> isCatalogAtStart: true
> isReadOnly: false
> nullPlusNonNullIsNull: true
> nullsAreSortedAtEnd: false
> nullsAreSortedAtStart: false
> nullsAreSortedHigh: false
> nullsAreSortedLow: true
> storesLowerCaseIdentifiers: true
> storesLowerCaseQuotedIdentifiers: true
> storesMixedCaseIdentifiers: false
> storesMixedCaseQuotedIdentifiers: false
> storesUpperCaseIdentifiers: false
> storesUpperCaseQuotedIdentifiers: true
> supportsAlterTableWithAddColumn: true
> supportsAlterTableWithDropColumn: true
> supportsANSI92EntryLevelSQL: true
> supportsANSI92FullSQL: false
> supportsANSI92IntermediateSQL: false
> supportsCatalogsInDataManipulation: true
> supportsCatalogsInIndexDefinitions: true
> supportsCatalogsInPrivilegeDefinitions: true
> supportsCatalogsInProcedureCalls: true
> supportsCatalogsInTableDefinitions: true
> supportsColumnAliasing: true
> supportsConvert: false
> supportsCoreSQLGrammar: true
> supportsCorrelatedSubqueries: true
> supportsDataDefinitionAndDataManipulationTransactions: false
> supportsDataManipulationTransactionsOnly: false
> supportsDifferentTableCorrelationNames: true
> supportsExpressionsInOrderBy: true
> supportsExtendedSQLGrammar: false
> supportsFullOuterJoins: false
> supportsGroupBy: true
> supportsGroupByBeyondSelect: true
> supportsGroupByUnrelated: true
> supportsIntegrityEnhancementFacility: false
> supportsLikeEscapeClause: true
> supportsLimitedOuterJoins: true
> supportsMinimumSQLGrammar: true
> supportsMixedCaseIdentifiers: false
> supportsMixedCaseQuotedIdentifiers: false
> supportsMultipleResultSets: false
> supportsMultipleTransactions: true
> supportsNonNullableColumns: true
> supportsOpenCursorsAcrossCommit: false
> supportsOpenCursorsAcrossRollback: false
> supportsOpenStatementsAcrossCommit: false
> supportsOpenStatementsAcrossRollback: false
> supportsOrderByUnrelated: false
> supportsOuterJoins: true
> supportsPositionedDelete: false
> supportsPositionedUpdate: false
> supportsSchemasInDataManipulation: false
> supportsSchemasInIndexDefinitions: false
> supportsSchemasInPrivilegeDefinitions: false
> supportsSchemasInProcedureCalls: false
> supportsSchemasInTableDefinitions: false
> supportsSelectForUpdate: true
> supportsStoredProcedures: true
> supportsSubqueriesInComparisons: true
> supportsSubqueriesInExists: true
> supportsSubqueriesInIns: true
> supportsSubqueriesInQuantifieds: true
> supportsTableCorrelationNames: true
> supportsTransactions: true
> supportsUnion: true
> supportsUnionAll: true
> usesLocalFilePerTable: false
> usesLocalFiles: false
> allProceduresAreCallable: false
> allTablesAreSelectable: false
> dataDefinitionCausesTransactionCommit: true
> dataDefinitionIgnoredInTransactions: false
> doesMaxRowSizeIncludeBlobs: true
> supportsBatchUpdates: true
> 922  INFO   [main] openjpa.jdbc.Schema - Reading table information  
> for schema
> name "bidspec", table name "country".
> 922  TRACE  [main] openjpa.jdbc.JDBC - <t 29919449, conn 9472129>  
> getColumns:
> bidspec, bidspec, country, null
> 969  TRACE  [main] openjpa.jdbc.Schema - Reading column information  
> for table
> "country".
> 969  TRACE  [main] openjpa.jdbc.Schema - Found existing column "id"  
> on table
> "country".
> 969  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "name" on table
> "country".
> 969  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "code" on table
> "country".
> 969  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "displayName" on
> table "country".
> 969  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "lastUpdated" on
> table "country".
> 985  TRACE  [main] openjpa.jdbc.JDBC - <t 29919449, conn 9472129>  
> [16 ms] close
> 985  TRACE  [main] openjpa.MetaData - Resolving mapping for
> "ca.BidSpec.emall.categories.Country@6771926".
> 1016  INFO   [main] openjpa.jdbc.Schema - Reading table information  
> for schema
> name "bidspec", table name "country".
> 1016  TRACE  [main] openjpa.jdbc.JDBC - <t 29919449, conn 2850225>  
> getColumns:
> bidspec, bidspec, country, null
> 1032  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "id" on table
> "country".
> 1032  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "name" on table
> "country".
> 1032  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "code" on table
> "country".
> 1032  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "displayName" on
> table "country".
> 1032  TRACE  [main] openjpa.jdbc.Schema - Found existing column  
> "lastUpdated" on
> table "country".
> 1063  TRACE  [main] openjpa.jdbc.JDBC - <t 29919449, conn 2850225>  
> [31 ms] close
> 1063  TRACE  [main] openjpa.MetaData - Clearing metadata repository
> "org.apache.openjpa.jdbc.meta.MappingRepository@d0220c".
> Exception in thread "main" <4|true|0.9.6-incubating>
> org.apache.openjpa.util.MetaDataException: Errors encountered while  
> resolving
> metadata.  See nested exceptions for details.
> 	at
> org.apache.openjpa.meta.MetaDataRepository.resolve 
> (MetaDataRepository.java:501)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.getMetaData 
> (MetaDataRepository.java:2
> 83)
> 	at
> org.apache.openjpa.jdbc.meta.MappingRepository.getMapping 
> (MappingRepository.java
> :271)
> 	at
> org.apache.openjpa.jdbc.meta.MappingTool.getMapping 
> (MappingTool.java:660)
> 	at
> org.apache.openjpa.jdbc.meta.MappingTool.validate(MappingTool.java: 
> 718)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:634)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java: 
> 1059)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:966)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java: 
> 907)
> Caused by: <4|true|0.9.6-incubating>  
> org.apache.openjpa.util.MetaDataException:
> Table "bidspec.country" given for  
> "ca.BidSpec.emall.categories.Country" does not
> exist.
> 	at
> org.apache.openjpa.jdbc.meta.MappingInfo.createTable 
> (MappingInfo.java:453)
> 	at
> org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable 
> (ClassMappingInfo.java:201
> )
> 	at
> org.apache.openjpa.jdbc.meta.strats.FullClassStrategy.map 
> (FullClassStrategy.java
> :68)
> 	at
> org.apache.openjpa.jdbc.meta.ClassMapping.setStrategy 
> (ClassMapping.java:343)
> 	at
> org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy( 
> RuntimeStr
> ategyInstaller.java:52)
> 	at
> org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping 
> (MappingRepository.
> java:305)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.preMapping 
> (MetaDataRepository.java:60
> 0)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.resolve 
> (MetaDataRepository.java:487)
> 	... 8 more
> NestedThrowables:
> <4|true|0.9.6-incubating>  
> org.apache.openjpa.util.MetaDataException: Table
> "bidspec.country" given for "ca.BidSpec.emall.categories.Country"  
> does not
> exist.
> 	at
> org.apache.openjpa.jdbc.meta.MappingInfo.createTable 
> (MappingInfo.java:453)
> 	at
> org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable 
> (ClassMappingInfo.java:201
> )
> 	at
> org.apache.openjpa.jdbc.meta.strats.FullClassStrategy.map 
> (FullClassStrategy.java
> :68)
> 	at
> org.apache.openjpa.jdbc.meta.ClassMapping.setStrategy 
> (ClassMapping.java:343)
> 	at
> org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy( 
> RuntimeStr
> ategyInstaller.java:52)
> 	at
> org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping 
> (ClassMapping.java:768)
> 	at
> org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1569)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.processBuffer 
> (MetaDataRepository.java
> :654)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.resolveMapping 
> (MetaDataRepository.jav
> a:615)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.resolve 
> (MetaDataRepository.java:493)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.getMetaData 
> (MetaDataRepository.java:2
> 83)
> 	at
> org.apache.openjpa.jdbc.meta.MappingRepository.getMapping 
> (MappingRepository.java
> :271)
> 	at
> org.apache.openjpa.jdbc.meta.MappingTool.getMapping 
> (MappingTool.java:660)
> 	at
> org.apache.openjpa.jdbc.meta.MappingTool.validate(MappingTool.java: 
> 718)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:634)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java: 
> 1059)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:966)
> 	at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java: 
> 907)
>
> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On  
> Behalf Of Marc
> Prud'hommeaux
> Sent: April 23, 2007 1:13 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: Validate and @table schema use
>
> Phill-
>
> It sounds like a bug, but it would help to know what the exception  
> was :)
>
>
> On Apr 23, 2007, at 7:02 AM, Phill Moran wrote:
>
>> I have been working with the validate tool and was getting an
>> exception on classes that used @table(name="XXX", schema="YYY").   
>> If I
>> took out the schema portion the exception went away. I see no mention
>> of not using schema in @table for validate use. Is this a bug or
>> undocumented feature
>>
>> The mapping tool knows which schema to use from the URL and
>> openJPA.schema properties
>>
>> Phill
>>
>


Mime
View raw message